Skip to content

Instantly share code, notes, and snippets.

@olafurw
Created June 26, 2016 21:24
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 olafurw/bbc650e891cd860c26d2f083dd2c3e12 to your computer and use it in GitHub Desktop.
Save olafurw/bbc650e891cd860c26d2f083dd2c3e12 to your computer and use it in GitHub Desktop.
int main()
{
int x = 4; // vanilla variable
int& y = x; // reference to the one above
int* z = &x; // pointer, without having to teach them about malloc or new, that can come later, just complicates things at first
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment