OSDN Git Service

Update index.md
authorIr1dXD <sirius.caffrey@gmail.com>
Sun, 25 Nov 2018 11:31:28 +0000 (19:31 +0800)
committerGitHub <noreply@github.com>
Sun, 25 Nov 2018 11:31:28 +0000 (19:31 +0800)
docs/string/index.md

index e01d40c..61376ef 100644 (file)
@@ -25,3 +25,9 @@
 -   字符串字面量:它们的值在编译过程中已经确定,保存在可执行目标文件的 `.rodata` 段内。
     调用 `objdump -s -j .rodata 文件名` 可以查看 `.rodata` 段的具体内容。
 -   字符数组、`vector`、`string`:局部变量保存在栈中,全局变量若初始化了保存在可执行目标文件的 `.data` 段内,若未初始化保存在 `.bss` 段。
+    ```c++
+    char rank[233];
+    // rank 在 .bss 段
+    char buf[233] = {0};
+    // buf 在 .data 段
+    ```