-
What will be the output of the following C code?
#include <stdio.h>
int n = 0;
void main()
{
int *const p = &n;
printf("%p\n", p);
p++;
printf("%p\n ", p);
}
-
- Same memory address
- Compilation Error
- Different memory address
- Garbage value
- None of these
Correct Option: B
main.c: In function ‘main’:
main.c:7:10: error: increment of read-only variable ‘p’
p++;