案例代码
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
//字符指针
char *pstr="good dog ww";
printf("字符指针指向的字符串内容:%s\n",pstr);
printf("字符指针本身的地址:%p\n",&pstr);
printf("字符指针指向的地址:%p\n",pstr);
printf("字符串常量的地址:%p\n","good dog ww");
printf("字符串的首个字符内容:%c\n",*pstr);
printf("======================================\n");
//字符数组
char c[]="hello";
printf("字符数组内容:%s\n",c);
printf("字符数组地址:%p\n",c);
printf("字符数组地址:%p\n",&c);
printf("hello字符串常量的地址:%p\n","hello");
printf("..........................\n");

最低0.47元/天 解锁文章
613

被折叠的 条评论
为什么被折叠?



