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;
}
 

猜你喜欢

转载自www.cnblogs.com/guoyan94/p/10885398.html
今日推荐