标题:关于strlen问题
取消只看楼主
xnccm3164614
Rank: 1
来 自:湖北
等 级:新手上路
帖 子:23
专家分:6
注 册:2010-9-24
结帖率:100%
已结贴  问题点数:10 回复次数:1 
关于strlen问题
#include<stdio.h>
#include<stdio.h> //提供strlen()函数的原型
#define PRAISE "What a super marvelous name!"
int main(void)
{
        char name[40];
        printf("What's you name?\n");
        scanf("%s",name);
        printf("Hellow, %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 occuples %d memory cells.\n",sizeof PRAISE);
        return 0;
}
gcc -Wall 3.c -o 3编译后的警告
3.c: In function ‘main’:
3.c:11: warning: implicit declaration of function ‘strlen’
3.c:11: warning: incompatible implicit declaration of built-in function ‘strlen’
希望给点提示能消除警告
搜索更多相关主题的帖子: memory super 
2011-03-24 18:37
xnccm3164614
Rank: 1
来 自:湖北
等 级:新手上路
帖 子:23
专家分:6
注 册:2010-9-24
得分:0 
谢谢各位啊!呵呵
2011-03-25 13:21



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-334659-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.182007 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved