]>
Commit | Line | Data |
---|---|---|
755ee3f6 | 1 | /* |
2 | ** Character arrays can be initialized using string literals (without becoming observers). | |
3 | */ | |
4 | ||
5 | void f (void) | |
6 | { | |
7 | char s0[] = "abc"; | |
8 | char s1[3] = "abc"; /* warning about no room for nullterminator */ | |
9 | char *p = "abc"; | |
10 | ||
11 | *s0 = 'b'; /* okay */ | |
12 | s1[1] = 'd'; /* okay */ | |
13 | *p = 'c'; /* error */ | |
14 | } |