| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 4865 人关注过本帖, 1 人收藏
标题:关于strlen问题
取消只看楼主 加入收藏
xnccm3164614
Rank: 1
来 自:湖北
等 级:新手上路
帖 子:23
专家分:6
注 册:2010-9-24
结帖率:100%
收藏(1)
已结贴  问题点数: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
快速回复:关于strlen问题
数据加载中...
 
   



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

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