C Programming - Pointers - Discussion
Discussion Forum : Pointers - General Questions (Q.No. 7)
7.
A pointer is
Discussion:
33 comments Page 2 of 4.
Minhaj said:
1 decade ago
Ya its a variable holding adress of other variable as a content of it.
Suryaiiit said:
1 decade ago
pointer is also variable it stores the addres of another variable and also stores addres of itself.
//
(i) int i,*p;
p=&i;
(ii) int *p;
p=&p;
//
both cases are possible i hope now u understand wt a pointer is
//
(i) int i,*p;
p=&i;
(ii) int *p;
p=&p;
//
both cases are possible i hope now u understand wt a pointer is
Michae Trussler said:
1 decade ago
The answer can be summarized as follows...
[A] A keyword used to create variables -> Wrong. A pointer is NOT a keyword.
[B]. A variable that stores address of an instruction -> Wrong. Though a pointer may hold the address of an instruction (i.e. function pointer), it is no required to
[C]. A variable that stores address of other variable -> Correct. A pointer is a variable that stores the address of any other variable be it a value or another address.
[D]. All of the above -> Wrong as A and B are incorrect.
[A] A keyword used to create variables -> Wrong. A pointer is NOT a keyword.
[B]. A variable that stores address of an instruction -> Wrong. Though a pointer may hold the address of an instruction (i.e. function pointer), it is no required to
[C]. A variable that stores address of other variable -> Correct. A pointer is a variable that stores the address of any other variable be it a value or another address.
[D]. All of the above -> Wrong as A and B are incorrect.
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."
"Program Counter also known as instruction pointer (IP) in Intel x86 holds the address of instruction."
Navin kumar said:
1 decade ago
A pointer store the address of the another variable.
Anuj said:
1 decade ago
A pointer is used to store the address of another variable.
Khushboo said:
1 decade ago
Hello michae Trussler.
Can you please explain why B is wrong?
Can you please explain why B is wrong?
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.
Hina said:
1 decade ago
Pointer is Variable Which Stores the adrress of Other 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).
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).
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers