...
In this noncompliant code example, the char pointer str is initialized to the address of a string literal. Attempting to modify the string literal is undefined behavior 32:
| Code Block | ||||
|---|---|---|---|---|
| ||||
char *str = "string literal"; str[0] = 'S'; |
...
...
In this noncompliant code example, the char pointer str is initialized to the address of a string literal. Attempting to modify the string literal is undefined behavior 32:
| Code Block | ||||
|---|---|---|---|---|
| ||||
char *str = "string literal"; str[0] = 'S'; |
...