简单例子分享007:definr和string
#include<stdio.h>#include<string.h>
#include<stdlib.h>
#defineisay "what a beautiful name."
int main (void)
{
char name ;
printf("please input your name:");
scanf("%s", name);
printf("hello %s,%s\n",name ,isay);
printf("your name of %lu letter,must have %lu\n ", strlen (name) ,sizeof name);//vs2012无法识别%zd,可以用%u或%ul代替!
system("pause");
return 0;
} 很好!不错
页:
[1]