Introduction to pointers in c
Pointer
is a variable just like other variables of c but only difference is
unlike the other variable it stores the memory address of any other
variables of c. This variable may be type of int, char, array,
structure, function or any other pointers. For examples:
(1)
Pointer p which is storing memory address of a int type variable:
int i=50;
int *p=&i;
(2)
Pointer p which is storing memory address of an array:
int arr[20];
int (*p)[20]=&arr;
(3)
Pointer p which is storing memory address of a function:
char display(void);
char(*p)(void)=&display;
(4)
Pointer p which is storing memory address of struct type variable:
struct abc{
int a;
float b;
}var;
struct abc *p=&var;
For pictorial explanation of pointer CLICK ME.
How to read complex pointer
Arithmetic operation with pointer
Pointer to function
Pointer to array of function
Pointer to array of string
Pointer to structure
pointer to union
Multi level pointer
Pointer to array of pointer to string
Pointer to three dimentional array
Pointer to two dimensional array
Sorting of array using pointer
Pointer to array of array
Pointer to array of union
Pointer to array of structure
Pointer to array of character
Pointer to array of integer
Complex pointer
Generic pointer
Null pointer
Wild pointer
Dangling pointer
Near pointer
Far pointer
Graphics video memory
Text video memory
Huge pointer
Memory model in C
No comments:
Post a Comment