-
What will be the output of the following C code?
#include <stdio.h>
void main()
{
int m = 10;
int *ptr1 = &m;
int **ptr2 = &ptr1;
printf("%d %d %d\n", m, *ptr1, **m);
}
-
- 10, 10, 10
- Same memory address
- Different memory address
- Garbage value
- Compilation Error
Correct Option: E
Compilation Error
main.c: In function ‘main’:
main.c:7:41: error: invalid type argument of unary ‘*’ (have ‘int’)
printf("%d %d %d\n", m, *ptr1, **m);