Skip to content

Instantly share code, notes, and snippets.

@VenkataPavan2494
Created April 15, 2018 08:36
Show Gist options
  • Save VenkataPavan2494/36587c78c79f836f4b168a2546a9daa3 to your computer and use it in GitHub Desktop.
Save VenkataPavan2494/36587c78c79f836f4b168a2546a9daa3 to your computer and use it in GitHub Desktop.
References from pointers
#include <iostream>
using namespace std;
int main(int argc, char ** argv) {
int myInteger {10};
cout << "myInteger = " << myInteger << endl;
int * pMyInteger = &myInteger;
cout << "*pMyInteger = " << *pMyInteger << endl;
int & refMyInteger = *pMyInteger;
cout << "refMyInteger = " << refMyInteger << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment