What happens if you try to modify a character in a string literal?

  • It converts the string to uppercase
  • It is allowed and won't cause any issues
  • It raises a compile-time error
  • It raises a run-time error
Modifying a character in a string literal is not allowed because string literals are stored in read-only memory, and attempting to modify them will result in a compile-time error.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *