pointers q 1
- Write a program having a variable i. Print the address of i. Pass this variable to a function and print its address. Are these addresses same? Why?
#include <stdio.h>
int address( int a ){
int *j =&a;
printf(" Address of %p is %p \n", a , &a);
return;
}
int main() {
// Write C code here
int i = 5 , p ;
int *j = &i ;
printf (" address of %d is %p \n", i , j);
p=address(j);
printf("%p\n", p );
return 0;
}
Comments
Post a Comment