-
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int num[5] = {11, 21, 31, 41, 51};
int ptr[5];
ptr = num;
printf("%d\n", ptr[2]);
}
-
- Undefined behaviour
- Garbage value
- Compilation Error
- 51
- None of these
Correct Option: C
Compilation Error
main.c: In function ‘main’:
main.c:6:13: error: assignment to expression with array type
ptr = num;