鱼蛋代码 发表于 2016-12-2 18:06:51

简单例子分享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;
}

15701168680 发表于 2017-1-4 16:52:49

很好!不错
页: [1]
查看完整版本: 简单例子分享007:definr和string