A pointer is a reference to a location in memory that is a primitive type in C and other low-level languages.
An example use would be if you wanted to store data at run-time, you would have to allocate memory using the malloc function, an you would access that memory area using a pointer
Example (modified from http://www.cplusplus.com/reference/clibrary/cstdlib/malloc):
#include <stdio.h>
#include <stdlib.h>
int main ()
{
int i,n;
char * buffer; // Declare a pointer to a char
printf ("How long do you want the string? ");
scanf ("%d", &i); // Get input from user and store in i
// Allocate space for i+1 characters
buffer = (char*) malloc ( sizeof( char[i+1] ) );
// buffer should now contains a pointer to this location
if (buffer==NULL)
exit (1); // Memory allocation failed, abort
for (n=0; n<i; n++)
buffer[n]=rand()%26+'a'; buffer[i]='\0';
printf ("Random string: %s\n",buffer);
free (buffer); // Release allocated memory return 0;
}
because u freakin can
A double pointer has two basic meanings. One is ofa pointer to a pointer, where changing the value ofdouble pointer will result in the original pointer being changed. Another is that of a two-dimentional array, such as a matrix, or a list of char* (e.g. in main when you use argv).
Pointer is a variable that stores the address of another variable. Since pointer is also akind of variable, thus pointer itself will be stored at a different memory location.
*
Generic pointer of type 'void *' is compatible with any (data-)pointer, but you cannot use the following operators on it: + - ++ -- += -= * -> []
A pointer to pointer has many uses, one of the simplest being 2D arrays (matrices). Compacting garbage collectors also often employ pointer pointers.
void pointer
Pointer is a variable that stores address of a variable . A NULL Pointer a pointer that doesn't point to anything, it is a literal zero .Some people ,notably C++ programmers, prefer to use 0 rather than NULL.
It depends on what type of data you wish to manipulate.
A Green Laser Pointer is very simple to use. In order to see the green laser from the pointer, you press the button and point it onto an opaque surface.
Pointer is a variable that stores the address of another variable . So pointer basically stores the address of another variable and size of pointer can be evaluated by using sizeof operator.
insert or delete values both side.so use double pointer