Skip to content

Instantly share code, notes, and snippets.

@Jack2
Created November 10, 2012 03:01
Show Gist options
  • Save Jack2/4049677 to your computer and use it in GitHub Desktop.
Save Jack2/4049677 to your computer and use it in GitHub Desktop.
[C++]pointer_example
#include <iostream>
using namespace std;
int main()
{
int a = 10;
cout << "Value a is " << a << endl;
cout << "Value &a is " << &a << endl;
int* a_ptr = &a;
*a_ptr = 1000;
cout << "Value a is " << a << endl;
cout << "Value &a is " << &a << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment