Skip to content

Instantly share code, notes, and snippets.

@ereidland
Created April 13, 2013 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ereidland/5379115 to your computer and use it in GitHub Desktop.
Save ereidland/5379115 to your computer and use it in GitHub Desktop.
Reference at Library.
//Format for functions:
//type name (arguments)
//{}
char * myFunction (int lol)
{
//Variables:
//type name;
char * myArray;
//Initializing to new array:
//(Type excludes asterisk.)
//name = new type [size];
myArray = new char [100];
//For declaring a fixed size array:
//type name [size];
//Size must be a constant integer, and constants must be defined at the start of the program.
char myFixedSizeArray[100];
//Note that all arrays are pointers.
//Format: return data.
return myArray;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment