...
Code Block | ||
---|---|---|
| ||
char* const * c = "Hello"; // Good //c[3] = 'a'; would cause a compile error |
...
Code Block | ||
---|---|---|
| ||
char* const * CMUfullname = "Carnegie Mellon"; /* get school from user input and validate */ if (strcmp(school,"CMU")) { school = CMUfullname; } |
...
Code Block | ||
---|---|---|
| ||
char* const * CMUfullname = "Carnegie Mellon"; /* get school from user input and validate */ if (strcmp(school,"CMU")) { //assuming school is properly allocated strcpy(school, CMUfullname); } |
...