函数调用
调用函数出现问题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;
}
求指教。。。。