3,504 views
1 1 vote
Which of the following gives the memory address of a variable pointed to by pointer a?
A. a;
B. *a;
C. &a;
D. address(a);

2 Answers

0 0 votes
"*" operator is used for accessing the content of the pointer.

It is also called as the dereferencing operator.
0 0 votes
Answer is A.

a would give the address of the variable pointed to by the pointer.

*a would fetch the value of that address location.
Position:
Show:

Related questions

8 8 votes
1 1 answer
283
283 views
GO Classes asked Jun 19
283 views
What is the output of the following code?#include <stdio.h void fun(int a[], int *p) { a = a + 5; *(p + 2) = *(p + 2) + 10; p++; *p = *p + 1; } int main() { int arr[] =...
6 6 votes
1 1 answer
229
229 views
GO Classes asked Jun 19
229 views
What is the output of the following code?#include <stdio.h int main() { int arr[] = {10, 20, 30}; int *p = arr; printf("%d %d", *p, *(arr + 2)); return 0; }$\texttt{10 20...
8 8 votes
1 1 answer
234
234 views
GO Classes asked Jun 6
234 views
What is the output of the following code?#include <stdio.h void change(int *p, int *q) { *p = *p + 4; *q = *p + *q; p = q; *p = *p - 3; } int main() { int a = 6, b = 10; ...
8 8 votes
1 1 answer
239
239 views
GO Classes asked Jun 6
239 views
What is the output of the following code?#include <stdio.h int main() { int a = 8, b = 12; int *p = &a; int *q = &b; *p = *p + *q; q = p; *q = *q - 5; printf("%d %d", a, ...