Multiple choice technology programming languages

What will be the output of the following: void main() { char * const ptr="abc"; ptr="xyz"; printf("%s",ptr); }

  1. abc

  2. xyz

  3. Compile time error

  4. None of these

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

char * const ptr means ptr is const (can't change what it points to). Trying to reassign ptr = xyz is illegal - compile error. The pointer itself is locked even though the data it points to isn't.