Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

/prog/ - RPG

Name: Anonymous 2010-10-29 15:44

Lets program a roleplaying game together. Each post must contain either a new function or an edited version of an old function in psudocode. I will start:

int dealDamage(int hp, int damage){
    return hp - damage;
}

Name: Anonymous 2010-10-31 4:59

>>73
Prefer structtag var; to typedefs (tag_t var;, or Class and String), since if it is a struct, make it look like a struct. Typedefs make code confusing and pollutes the namespace, while struct tags have their own namespace. Only typedef if it is compilation target dependent, and often not even then. It is allowed, though, to typedef function pointer, if you must.

If you use a struct very often in a file, then you can typedef it locally within that file and give it a locally relevant name.

PS. Don't use a C++ compiler to compile C. It will rape your brain.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List