C examples for Function:Function Parameter
Use pointers to pass arguments by reference.
#include <stdio.h> void demoPassByReference(int *); int main()/* w ww .j ava 2 s . c o m*/ { int x = 0; printf("\nEnter a number: "); scanf("%d", &x); demoPassByReference(&x); printf("\nThe original value of x is: %d\n", x); } void demoPassByReference(int *ptrX) { *ptrX += 5; printf("\nThe value of x is now: %d\n", *ptrX); }