Pointers
- What will be the output of the following C code?
#include <stdio.h>
int num = 0;
void main()
{
int *p = #
printf("%p\n", p);
num++;
printf("%p\n ", p);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
Same memory address
- Which of the following does not initialize p to null (assuming variable declaration of n as int n=0;)?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
int *p = &n;
- Which is an indirection operator among the following?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
*
- Comment on the following C statement.
const int *p;
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
You cannot change the value pointed by p
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
int *p, n = 15;
p = &n;
*p += 10;
printf("%d, %d\n", *p, n);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
25, 25