Govt. Exams
Entrance Exams
On a 32-bit system, all pointers are 4 bytes (32 bits) regardless of the data type they point to.
Pointers store memory addresses of variables. The address-of operator (&) retrieves this address.
char *str = "Hello";
printf("%c", *str);
*str dereferences the pointer to get the first character of the string, which is 'H'.
& is a reference operator used in C++, not in C. In C, pointers are declared using *.
A NULL pointer is a pointer that points to memory address 0, indicating it doesn't point to any valid memory location.
On a 64-bit system, a pointer is 8 bytes (64 bits) regardless of the data type it points to.
The & operator (address-of operator) returns the memory address of a variable.