Pointers in C

Pointers like all other variables in C must be declared as such prior to use.

Syntax : type *ptr ;

which indicates that ptr is a pointer to a variable of type type. For example
int *ptr ;

declares a pointer ptr to variables of type int.

 The type of the pointer variable ptr is int *. The declaration of a pointer variable normally sets aside just two or four bytes of storage for the pointer whatever it is defined to point to. In 16-bit systems two byte pointers are termed near pointers and are used in small memory model programs where all addresses are just segment offset addresses and 16 bits in length. In larger memory model programs addresses include segment and offset addresses and are 32 bits long and thus pointers are 4 bytes in size and are termed far pointers. In 32-bit systems we have a flat address system where every part of memory is accessible using 32-bit pointer.

Pointers in C Pointers in C Reviewed by Unknown on 04:43 Rating: 5

No comments:

Powered by Blogger.