C Programming - Pointers - Discussion

Discussion Forum : Pointers - General Questions (Q.No. 7)
7.
A pointer is
A keyword used to create variables
A variable that stores address of an instruction
A variable that stores address of other variable
All of the above
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
33 comments Page 2 of 4.

Jim said:   1 decade ago
Your answer is confusing because pointers can ALSO store things that are not variables.

A variable is something that has a type, value, and a symbolic name.

- Pointer to a string constant. char *p = "Hello";
Note that a string constant does not have a name. This is not a pointer to a variable.

- Pointer to dynamic memory. int *p = (int *) malloc(10);
Note that the memory dynamically allocated is mutable but it is not a variable because it has no name.

What about a pointer to a function?

Sahil said:   1 decade ago
Can somebody please give some effective answer as to why option B is wrong Because a pointer can also store address of an instruction viz. Function pointer. So they why B is considered wrong ?

Latha said:   1 decade ago
Can you please explain pointer is used to store address of that variable or address of another variable?

Reza said:   1 decade ago
Definition:

int *p;
*p = 10;

Explanation:

p is a variable with the type of pointer that stores the address of an anonymous variable with the type of integer (here is its value equals 10).

Hina said:   1 decade ago
Pointer is Variable Which Stores the adrress of Other variable.

Mclean said:   1 decade ago
A pointer is simply a variable which holds the address of another variable there on can use it to access a variable by pointing to it.

Khushboo said:   1 decade ago
Hello michae Trussler.

Can you please explain why B is wrong?

Anuj said:   1 decade ago
A pointer is used to store the address of another variable.

Navin kumar said:   1 decade ago
A pointer store the address of the another variable.

Shashank said:   1 decade ago
Pointer is a generic term which means "pointing to something".We can use pointer to store address of any variable or any function (Function pointer).
"Program Counter also known as instruction pointer (IP) in Intel x86 holds the address of instruction."


Post your comments here:

Your comments will be displayed after verification.