Last active
September 1, 2016 06:43
-
-
Save bibhas/50385ecaab021029e388439b59a42255 to your computer and use it in GitHub Desktop.
For Bidit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
void funcWithReference(int &ref) | |
{ | |
ref = 659; | |
} | |
void funcWithPtr(int *ptr) | |
{ | |
*ptr = 659; // ignore this | |
} | |
int main(int argc, const char **argv) | |
{ | |
int value = 227; | |
std::cout << "Starting value = " << value << std::endl; | |
funcWithPtr(&value); | |
// funcWithReference(value); | |
std::cout << "End value is = " << value << std::endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment