码迷,mamicode.com
首页 > 编程语言 > 详细

C语言_字符串常量

时间:2019-05-18 13:47:15      阅读:128      评论:0      收藏:0      [点我收藏+]

标签:code   ret   turn   oid   地址   mic   return   std   文字   

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;
}
技术图片

 

 

C语言_字符串常量

标签:code   ret   turn   oid   地址   mic   return   std   文字   

原文地址:https://www.cnblogs.com/guoyan94/p/10885398.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!