c语言小程序 帮我看看哪里错了
#include<stdio.h>voidtry(int,int,int);main(){intx=2,y=3,z=0;pirntf("%d%d%d",x,y,z);tr...
#include <stdio.h>
void try(int,int,int);
main()
{
int x=2,y=3,z=0;
pirntf("%d%d%d",x,y,z);
try(x,y,z);
pirntf("%d%d%d",x,y,z);
}
void try(int x,int y,int z);
{
pirntf("%d%d%d",x,y,z);
z=x+y;
x=x*x;
y=y*y;
pirntf("%d%d%d",x,y,z);
}
--------------------Configuration: 函数如何传递 - Win32 Debug--------------------
Compiling...
函数如何传递.cpp
G:\c语言的暑假\3\函数如何传递.cpp(2) : warning C4091: '' : ignored on left of 'void' when no variable is declared
G:\c语言的暑假\3\函数如何传递.cpp(2) : error C2143: syntax error : missing ';' before 'try'
G:\c语言的暑假\3\函数如何传递.cpp(2) : error C2143: syntax error : missing ';' before 'try'
G:\c语言的暑假\3\函数如何传递.cpp(6) : error C2065: 'pirntf' : undeclared identifier
G:\c语言的暑假\3\函数如何传递.cpp(7) : error C2319: 'try' must be followed by a compound statement. Missing '{'
G:\c语言的暑假\3\函数如何传递.cpp(8) : error C2317: 'try' block starting on line '7' has no catch handlers
G:\c语言的暑假\3\函数如何传递.cpp(9) : warning C4508: 'main' : function should return a value; 'void' return type assumed
G:\c语言的暑假\3\函数如何传递.cpp(10) : warning C4091: '' : ignored on left of 'void' when no variable is declared
G:\c语言的暑假\3\函数如何传递.cpp(10) : error C2143: syntax error : missing ';' before 'try'
G:\c语言的暑假\3\函数如何传递.cpp(10) : error C2143: syntax error : missing ';' before 'try'
G:\c语言的暑假\3\函数如何传递.cpp(11) : error C2447: missing function header (old-style formal list?)
执行 cl.exe 时出错.
函数如何传递.obj - 1 error(s), 0 warning(s)
小弟很菜鸟 见谅 勿喷 展开
void try(int,int,int);
main()
{
int x=2,y=3,z=0;
pirntf("%d%d%d",x,y,z);
try(x,y,z);
pirntf("%d%d%d",x,y,z);
}
void try(int x,int y,int z);
{
pirntf("%d%d%d",x,y,z);
z=x+y;
x=x*x;
y=y*y;
pirntf("%d%d%d",x,y,z);
}
--------------------Configuration: 函数如何传递 - Win32 Debug--------------------
Compiling...
函数如何传递.cpp
G:\c语言的暑假\3\函数如何传递.cpp(2) : warning C4091: '' : ignored on left of 'void' when no variable is declared
G:\c语言的暑假\3\函数如何传递.cpp(2) : error C2143: syntax error : missing ';' before 'try'
G:\c语言的暑假\3\函数如何传递.cpp(2) : error C2143: syntax error : missing ';' before 'try'
G:\c语言的暑假\3\函数如何传递.cpp(6) : error C2065: 'pirntf' : undeclared identifier
G:\c语言的暑假\3\函数如何传递.cpp(7) : error C2319: 'try' must be followed by a compound statement. Missing '{'
G:\c语言的暑假\3\函数如何传递.cpp(8) : error C2317: 'try' block starting on line '7' has no catch handlers
G:\c语言的暑假\3\函数如何传递.cpp(9) : warning C4508: 'main' : function should return a value; 'void' return type assumed
G:\c语言的暑假\3\函数如何传递.cpp(10) : warning C4091: '' : ignored on left of 'void' when no variable is declared
G:\c语言的暑假\3\函数如何传递.cpp(10) : error C2143: syntax error : missing ';' before 'try'
G:\c语言的暑假\3\函数如何传递.cpp(10) : error C2143: syntax error : missing ';' before 'try'
G:\c语言的暑假\3\函数如何传递.cpp(11) : error C2447: missing function header (old-style formal list?)
执行 cl.exe 时出错.
函数如何传递.obj - 1 error(s), 0 warning(s)
小弟很菜鸟 见谅 勿喷 展开
6个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询