C++ examples for Function:Function Parameter
With References, You Don't Need Pointers!
#include <iostream> using namespace std; void myFunction(int &myparam) { myparam = myparam * 2 + 10; /*from w w w . j ava2 s . c om*/ } int main() { int mynumber = 30; myFunction(mynumber); cout << mynumber << endl; return 0; }