#include
#include
#define PRAISE "What a super marvelous name!"
int main(void)
{
char name[40];
printf("What's your name?\n");
scanf("%s",name);
printf("Hello,%s,%s\n",name,PRAISE);
printf("Your name of %d letters occupies %d memory cells.\n",strlen(name),sizeof name);
printf("The phrase of praise has %d letters",strlen(PRAISE));
printf("and occupies %d memory cells.\n",sizeof PRAISE);
return 0;
}
哪裡出問題了,遠行是說char name[40]這行錯誤
你中括號是中文格式的,char name[40];所以報錯
scanf("%s",name);這個寫法也是對的,樓上的說法我暈了。。。