Structure and Union
In this example, We will learn a simple program for pointer. Before that, You must have knowledge of the following topics.
Learn C programming directly from mobile. This app includes tutorials with topics, examples and live compiler.
Few Notes to remember:
int var = 24; // actual variable declaration
p = &var; // storing address of int variable var in pointer p
printf("\n\nAddress of var variable is: %x \n\n", &var);
// address stored in pointer variable
printf("\n\nAddress stored in pointer variable p is: %x", p);
// access the value using the pointer variable
printf("\n\nValue of var variable or the value stored at address p is %d ", *p);
the output of above code is
Address of var variable is: 61ff18
Address stored in pointer variable p is: 61ff18
Value of var variable or the value stored at address p is 24
Get the latest tutorials, examples and projects updates.
Ads Blocker Detected!!!
We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.
Disable Ad Block
Want Same System