标题:函数调用
取消只看楼主
kellybinble
Rank: 1
等 级:新手上路
帖 子:18
专家分:6
注 册:2013-9-8
结帖率:80%
已结贴  问题点数:20 回复次数:0 
函数调用
调用函数出现问题E:\MyProjects\bijiao\Untitled2.c||In function 'max':|
E:\MyProjects\bijiao\Untitled2.c|6|error: expected declaration specifiers before 'scanf'|
E:\MyProjects\bijiao\Untitled2.c|7|error: expected declaration specifiers before 'c'|
E:\MyProjects\bijiao\Untitled2.c|8|error: expected declaration specifiers before 'printf'|
E:\MyProjects\bijiao\Untitled2.c|9|error: expected declaration specifiers before 'return'|
E:\MyProjects\bijiao\Untitled2.c|11|error: expected declaration specifiers before '}' token|
E:\MyProjects\bijiao\Untitled2.c|13|error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token|
E:\MyProjects\bijiao\Untitled2.c|4|error: old-style parameter declarations in prototyped function definition|
E:\MyProjects\bijiao\Untitled2.c|17|error: expected '{' at end of input|
E:\MyProjects\bijiao\Untitled2.c|17|warning: no return statement in function returning non-void|
E:\MyProjects\bijiao\Untitled2.c||In function 'main':|
E:\MyProjects\bijiao\Untitled2.c|17|error: expected declaration or statement at end of input|
||=== Build finished: 9 errors, 1 warnings ===|
程序如下:
#include<stdio.h>
int main()
{
    int max(int x,int y)
    int a,b,c;
    scanf ("%d,%d",&a,&b);
    c=max(a,b);
    printf ("Max is%d\n",c);
    return 0;

}
int max(int x,int y)
{
    int z;
    z=x>y? x:y;
    return 0;
}
求指教。。。。
搜索更多相关主题的帖子: return expected function before 
2013-09-26 19:25



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




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

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