Exams:
MAKAUT BTech CSE
Answer:
A pointer is a variable that stores the address of some other variable, instead of data. An integer variable can store some integer value, but an integer type pointer variable can only hold the address of an integer variable. We can also access and change the value of the integer variable using the pointer.
Explanation
The “data” stored within a pointer variable is considered as an “address”.
“37, M. N. Sen Street, Kolkata 700001 ” – Is it an address or data?
When we see the above text on an envelope, the text is considered to be an address. But, if we see the same text on someone’s driving license or Adhar Card, the same text is considered to be data. Similarly, The data stored within a pointer variable is a Hexadecimal number which represents the address of some variable.
Example:
The following code snippet shows how to use a pointer.
int main(){
int x; // creating an integer
int *p; // creating a pointer to integer variable
x = 5;
p = &x;
printf("x contains %d at location %x", x , &x);
printf("\n");
printf("p contains %x at location %x", p , &p);
printf("\nAccessing x via p:-\n");
printf("value of x is %d", *p);
return 0;
}
Related Question:
- What is the address of any variable?
- Can a pointer variable store values?
- What type of values can be stored in a pointer variable?
- Can we perform addition or subtraction on pointers?
- What is the use of * while using pointers in C?
Simply want to say your article is as astonishing. The clarity in your post is just nice and i could assume you are an expert on this subject. Well with your permission allow me to grab your RSS feed to keep updated with forthcoming post. Thanks a million and please keep up the rewarding work.
https://turkiserial.co/
At this time it appears like Expression Engine is the best blogging platform out there right now. (from what I’ve read) Is that what you are using on your blog?
http://www.arusak-attestats.ru