A pointer is a variable. Like any other variable, it consumes memory (4 bytes on a 32-bit system). So you can have as many pointers as you like, with as many levels of indirection as you like, the only limit being dictated by available memory (which can never exceed 4GB on a 32-bit system).
Pointer-to-pointer variables are no different to pointer variables (and therefore have the same limitation as pointer variables), except that a pointer variable points to a non-pointer variable (such as int) whereas a pointer-to-pointer variable points to a pointer variable of the same type (which, in turn, points to a non-pointer variable of the same type). In other words, pointer-to-pointer variables add an extra level of indirection. You can also indirect pointer-to-pointer variables via pointer-to-pointer-to-pointer variables, and so on.
Pointer indirection is useful because, without them, pointers would always be passed to functions by value (never by reference). Passing by value copies the pointer variable, which means you can mutate the memory it points to, but you cannot change where it points (because that would only affect the copy, not the original pointer that was passed).
To pass a pointer by reference you must pass the pointer indirectly, via a pointer-to-pointer, which is itself passed by value. This allows the function to mutate the pointer variable (changing where it points), as well mutating the memory it points to.
Indirect pointers are also useful when allocating dynamic multi-dimensional arrays because each additional dimension requires an additional level of indirection.
a pointer is a derived data type in c. pointers are undoubtedly one of the most distinct and exciting features of c language.it has added power and flexibility to the language. *pointers are more efficient in handling arrays and tables. *pointer can be used to support dynamic memory management. *pointers reduce length and complexity of programs. *increase the execution speed and thus reduce the program execution time. by following character's real power of c lies in proper use of pointers. pointer is called the jewel of c-language.
Pointers in C are generally the thing that gives learners the most trouble. When C code is not written correctly with respect to pointer use, the resulting bugs can often be very difficult to find and correct. On the other hand, pointers are absolutely necessary in some cases.The designers of Java wanted to make programming easier and hence avoided adding pointers to the language. Java does have object references which accomplish much of what pointers accomplish albeit in a safer way.
A C++ program can be used to write C programs that will display 10 lines of biodata. Many types of C programming can be written with a C++ program.
Pointer can be defined as variable that is used to store memory address , usually the location another variable in memory. Pointers provide a means through which memory location of a variable can be directly accessed.
A pointer is simply a variable that can store a memory address and has the same purpose in both languages. The only real difference is that C++ pointers can point at objects (instances of a class) and indirectly invoke their methods, whereas pointers in C (which is not object oriented) cannot.
program to find maximum of two numbers using pointers
* * * * * * * * * * write the c++ program and show me brifily?
pro c language to implement linear search using pointers
nahi malum
a pointer is a derived data type in c. pointers are undoubtedly one of the most distinct and exciting features of c language.it has added power and flexibility to the language. *pointers are more efficient in handling arrays and tables. *pointer can be used to support dynamic memory management. *pointers reduce length and complexity of programs. *increase the execution speed and thus reduce the program execution time. by following character's real power of c lies in proper use of pointers. pointer is called the jewel of c-language.
i cant write
Java doesn't have pointers. C++ has pointers.
Let's suppose, you wanted to ask:Why thisis used as a pointer in C++ language? Because it is a pointer to the 'current object'.
mystrcpy (char* dest, char* src) { while ((*dest++ = *src++) != '\0); }
Pointers in C are generally the thing that gives learners the most trouble. When C code is not written correctly with respect to pointer use, the resulting bugs can often be very difficult to find and correct. On the other hand, pointers are absolutely necessary in some cases.The designers of Java wanted to make programming easier and hence avoided adding pointers to the language. Java does have object references which accomplish much of what pointers accomplish albeit in a safer way.
C does not have stream pointers.
A C++ program can be used to write C programs that will display 10 lines of biodata. Many types of C programming can be written with a C++ program.