.rodataセクションに文字列が格納されるみたいよね。文字列リテラルはそこへのポインタとして扱われるんだとおもー
$ objdump -s a.out
:
Contents of section .rodata:
2000 01000200 48656c6c 6f2c2077 6f726c64 ....Hello, world
2010 00 .
:
.rodataセクションに文字列が格納されるみたいよね。文字列リテラルはそこへのポインタとして扱われるんだとおもー
$ objdump -s a.out
:
Contents of section .rodata:
2000 01000200 48656c6c 6f2c2077 6f726c64 ....Hello, world
2010 00 .
:
文字列リテラルはつながるの件
$ cat test.c; gcc test.c && ./a.out
#include <stdio.h>
#define place "world"
void main(void){puts("Hello, " place);}
Hello, world
076萌SNS is a social network, courtesy of 076. It runs on GNU social, version 2.0.2-beta0, available under the GNU Affero General Public License.
All 076萌SNS content and data are available under the Creative Commons Attribution 3.0 license.