Pass by reference...
#include <stdio.h>
void display( int *);
int main()
{ int num = 10;
printf("num = %d\n", num);
printf("memory location of num variable is %u\n", &num);
display(&num);
printf("now i am completed pass by refrence too\n");
return 0;
}
void display(int *pointer){
;
printf(" value at pointer variable is %d\n", *pointer);
printf("memory address of pointer is %u\n", &pointer);
*pointer = 20;
printf("memory address of pointer is %u\n", *pointer);
}
Comments
Post a Comment