pointers examples in c
Example 1: poiner in c
int* pc, c, d;
c = 5;
d = -15;
pc = &c; printf("%d", *pc);
pc = &d; printf("%d", *pc);
Example 2: poiner in c
#include <stdio.h>
int main()
{
int var =10;
int *p;
p= &var;
printf ( "Address of var is: %p", &var);
printf ( "\nAddress of var is: %p", p);
printf ( "\nValue of var is: %d", var);
printf ( "\nValue of var is: %d", *p);
printf ( "\nValue of var is: %d", *( &var));
printf( "\nValue of pointer p is: %p", p);
printf ( "\nAddress of pointer p is: %p", &p);
return 0;
}