0
What is the output of the following C code?
int x = 10;
void modify(int *p) {
*p += 5;
p = NULL;
}
int main() {
int *ptr = &x;
modify(ptr);
printf("%d", *ptr);
return 0;
}
- A10
- B15
- CCompilation error
- DSegmentation fault
Correct answer: B