This statement instructs the system to reserve a 2-byte memory location and puts the value 84 in that location. Assume that a system allocates memory location 1001 for num. diagrammatically, it can be shown as.
It is a special variable which stored address of another variable.
Declaration of pointer We can declare pointer similarly as we declared any variable in C.Syntax: *pointervariable; Int *iptr; float *fptr; char *cptr;This tells the compiler three things about the variable iptr.
Int* iptr; Int * iptr; Int *iptr;
Syntax: Pointer_variable = &variable;EX
int a= 20; int *iptr; iptr = &a; /* pointer assignment */ (& )means address ofEX: WAP to print address of variable
#include<stdio.h> #include<conio.h> void main() { int age =30; float sal = 1500.50; clrscr(); printf("Address of age=%u\n",&age); printf("Address of salary=%u\n",&sal); getch(); }