C examples for Function:Function Parameter
We can use pointer syntax to pass the variable by address.
An argument passed by address can be changed and the change will affect the original variable.
#include <stdio.h> void set(int* i) { *i = 1; } int main(void) { int x = 0;/* w w w . ja v a 2 s . c o m*/ set(&x); printf("%d", x); /* "1" */ }