Compare array with pointer

Compare array with pointer.

The following declarations are NOT the same:

char *p;
char a[20];

The first declaration allocates memory for a pointer; the second allocates memory for 20 characters.

Define pointer in C.

A pointer is an address location of another variable. It is a value that designates the address or memory location of some other value (usually value of a variable). The value of a variable can be accessed by a pointer which points to that variable. To do so, the reference operator (&) is pre-appended to the variable that holds the value. A pointer can hold any data type, including functions.
What is NULL pointer?
A null pointer does not point to any object. NULL and 0 are interchangeable in pointer contexts.Usage of NULL should be considered a gentle reminder that a pointer....
Difference between Function to pointer and pointer to function
A pointer to a function is a pointer that points to a function. A function pointer is a pointer that either has an indeterminate value, or has a null pointer value, or points to a function
#pragma statements
The #pragma Directives are used to turn ON or OFF certain features. They vary from compiler to compiler. Examples of pragmas are:.....
Post your comment
Discussion Board
Pointers and arrays
int *ptr;
int a[20];

In the above declarations *ptr is explicit pointer where as a[20] is an array, treated as implicit pointers. *ptr may be point to a single block or even one dimensional array(ie a block containing more than 2 bytes of memory). In the second declaration a[20],'a' is the name of array holding address of the first block of the array,hence implicit pointer. Using the base address we can process the entire array .Hence we can say that the array name is referring the entire array.
Ravi Kumar 02-1-2012