C++ examples for Function:Function Parameter
Passing by Reference
#include <iostream> using namespace std; void ReturnSum(int inValueA, int inValueB, int& outValue) { outValue = inValueA + inValueB; } int main(int argc, char *argv []) { int sum = 0; ReturnSum(3, 6, sum); /* w w w . ja v a 2 s. c om*/ cout << sum << endl; return 0; }