标题:为什么编译不通过??
取消只看楼主
xzy199999
Rank: 4
等 级:业余侠客
帖 子:326
专家分:286
注 册:2010-11-19
结帖率:92.45%
已结贴  问题点数:20 回复次数:3 
为什么编译不通过??
主函数 #include "plus.h"
#include <stdio.h>
int main(int argc, char* argv[])
{
 int a=1,b=2; printf("%d\n",plus(a,b));
return 0; }
plus.h  :
#ifndef PLUS_H
 #define PLUS_H
int plus(int a, int b);
#endif  
plus.c:
 #include "plus.h"
#include<stdio.h>  
int plus(int a,int b)
{     return (a+b); }  
搜索更多相关主题的帖子: 函数 include return 
2011-03-22 18:36
xzy199999
Rank: 4
等 级:业余侠客
帖 子:326
专家分:286
注 册:2010-11-19
得分:0 
一共3个文件,主文件是
#include "plus.h"
#include <stdio.h>
int main(int argc, char* argv[])
{
int a=1,b=2; printf("%d\n",plus(a,b));
return 0; }
plus.h文件是
#ifndef PLUS_H
#define PLUS_H
int plus(int a, int b);
#endif  
plus.c文件是
#include "plus.h"
#include<stdio.h>  
int plus(int a,int b)
{     return (a+b); }   

我是初学者
2011-03-22 19:16
xzy199999
Rank: 4
等 级:业余侠客
帖 子:326
专家分:286
注 册:2010-11-19
得分:0 
有图为证,确实不行

我是初学者
2011-03-22 21:56
xzy199999
Rank: 4
等 级:业余侠客
帖 子:326
专家分:286
注 册:2010-11-19
得分:0 
回复 12楼 icesky0223
你这样子加plus.h也没什么意义了

我是初学者
2011-03-22 23:14



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




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

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