String literals in C are immutable
This commit is contained in:
parent
79feae563b
commit
d904cf0dea
|
@ -149,7 +149,7 @@ let z = 2
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<pre>
|
<pre>
|
||||||
char* s = "Hello World.";
|
char s[] = "Hello World.";
|
||||||
char s0 = s[0]; // 'H'
|
char s0 = s[0]; // 'H'
|
||||||
char *t = s; // Ptr to s
|
char *t = s; // Ptr to s
|
||||||
s[11] = '!';
|
s[11] = '!';
|
||||||
|
|
Loading…
Reference in New Issue