fanny hillTXT:C语言题目,谁可以为我解决?

来源:百度文库 编辑:高校问答 时间:2024/05/03 16:10:29
s="show"
用指针计算出s字符串中某一个字符在内存指针的地址。

#include <stdio.h>
main()
{
char s[10] = "show";
char *p =s;
while(*p)
{
printf("%c:[0x%08X\n",*p,p++);
}
}

#include <stdio.h>
main()
{ char s[10] = "show";
char *p;
for(i=0;s[i]!='0';i++)
{ p=&s[i];
printf("%c %d",*p,p);
}
}