-
What will be the output of the following C code?
#include <stdio.h>
void main()
{
int array[4] = {11, 12, 13, 14};
int *ptr1 = array;
int *ptr2 = &ptr1;
printf("%d", (**ptr2));
}
-
- 11
- 12
- 13
- 14
- Compilation Error
Correct Option: E
Compilation Error
main.c: In function ‘main’:
main.c:6:21: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
int *ptr2 = &ptr1;
^
main.c:7:23: error: invalid type argument of unary ‘*’ (have ‘int’)
printf("%d", (**ptr2));