Skip to content

Instantly share code, notes, and snippets.

@bibhas
Last active September 1, 2016 06:43
Show Gist options
  • Save bibhas/50385ecaab021029e388439b59a42255 to your computer and use it in GitHub Desktop.
Save bibhas/50385ecaab021029e388439b59a42255 to your computer and use it in GitHub Desktop.
For Bidit
#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