answersLogoWhite

0


Best Answer
Answergenerally we use simple pointer, void pointer,null pointer, structure pointer. Answerzero or more (unlimited).
User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

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.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How many pointers can be used in a c program?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Why pointer is callded jewel of c language?

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.


In C you use the concept of pointers whereas there are no pointers used in JAVA why?

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.


Write c programs to display 10 line biodata?

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.


How do pointer work in 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.


Difference between array and pointers in c plus plus?

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.

Related questions

How to write a C program to find largest 2 numbers using pointers?

program to find maximum of two numbers using pointers


Write a program to illustrate the usage of pointers with arrarys and functions?

* * * * * * * * * * write the c++ program and show me brifily?


How do you run graphics program in C?

pro c language to implement linear search using pointers


Write a c program to copy two strings using pointers?

nahi malum


Why pointer is callded jewel of c language?

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.


How do you write c program to perform sum of elements of matrix using pointers with functions?

i cant write


What is the difference between c plus plus and java programming?

Java doesn't have pointers. C++ has pointers.


Why does is used as a pointers in c language?

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'.


How do you write a C program to copy to strings using pointers?

mystrcpy (char* dest, char* src) { while ((*dest++ = *src++) != '\0); }


In C you use the concept of pointers whereas there are no pointers used in JAVA why?

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.


What is stream pointer in c?

C does not have stream pointers.


Write c programs to display 10 line biodata?

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.