C++ examples for Function:Function Parameter
Passing by Pointer
#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); // ww w. j av a 2s . co m cout << sum << endl; return 0; }