mirror of
https://github.com/wangdoc/clang-tutorial.git
synced 2026-02-03 10:53:37 +08:00
docs(string): fixed typo #19
This commit is contained in:
@@ -136,7 +136,7 @@ s[0] = 'z';
|
||||
为了提醒用户,字符串声明为指针后不得修改,可以在声明时使用`const`说明符,保证该字符串是只读的。
|
||||
|
||||
```c
|
||||
const char* s = "ello, world!";
|
||||
const char* s = "Hello, world!";
|
||||
```
|
||||
|
||||
上面字符串声明为指针时,使用了`const`说明符,就保证了该字符串无法修改。一旦修改,编译器肯定会报错。
|
||||
|
||||
Reference in New Issue
Block a user