-
What will be the output of the following C code?
#include <stdio.h>
void fun(int*);
int main()
{
int num = 10;
fun((&num)++);
}
void fun(int *ptr)
{
printf("%d\n", *ptr);
}
-
- Compilation Error
- 113
- Garbage value
- Runtime Error
- None of these
Correct Option: A
Compilation Error
main.c: In function ‘main’:
main.c:6:19: error: lvalue required as increment operand
fun((&num)++);