Justify and explain the different size of data types using pointer variables with example program.
Answers
Answer:
The Pointer in C, is a variable that stores address of another variable. A pointer can also be used to refer to another pointer function. A pointer can be incremented/decremented, i.e., to point to the next/ previous memory location. The purpose of pointer is to save memory space and achieve faster execution time.
How to Use Pointers in C
If we declare a variable v of type int, v will actually store a value.
v is equal to zero now.
However, each variable, apart from value, also has its address (or, simply put, where it is located in the memory). The address can be retrieved by putting an ampersand (&) before the variable name.
If you print the address of a variable on the screen, it will look like a totally random number (moreover, it can be different from run to run).