Tag: 字符串池

字符串文字的C优化

刚刚在gdb中检查以下内容: char *a[] = {“one”,”two”,”three”,”four”}; char *b[] = {“one”,”two”,”three”,”four”}; char *c[] = {“two”,”three”,”four”,”five”}; char *d[] = {“one”,”three”,”four”,”six”}; 我得到以下内容: (gdb) pa $17 = {0x80961a4 “one”, 0x80961a8 “two”, 0x80961ac “three”, 0x80961b2 “four”} (gdb) pb $18 = {0x80961a4 “one”, 0x80961a8 “two”, 0x80961ac “three”, 0x80961b2 “four”} (gdb) pc $19 = {0x80961a8 “two”, 0x80961ac “three”, 0x80961b2 “four”, 0x80961b7 “five”} (gdb) […]