C语言_字符串常量

1,每个字符串都是一个地址,这个地址是指字符串首元素地址

2,字符串常量放在data区,文字常量区

 

#include<stdio.h>
void fun()
{
 printf("fun = %p\n","hello world");
}
int main()
{
 printf("s1 = %s\n","hello world");
 printf("s2 = %p\n","hello world");
 printf("s3 = %s\n","hello world" + 1);
 fun();
 return 0;
}

 

 
posted @ 2019-05-18 12:52  半沙淋漓墨迹25  阅读(283)  评论(0)    收藏  举报