, . ++, ++, , .
++
++
_ ( _)
{
//
}
__ . , . , void.
, .
, ( ), .
, , .
, .
. ++-, . ( ) return
.
#include<iostream>
using namespace std;
void myfunc();// myfunc()
void main()
{
cout<< main().<<endl;
myfunc();
cout<< main().<<endl;
}
// myfunc()
void myfunc()
{
cout<< myfunc().<<endl;
}
. . , .
, , , . .
#include<iostream>
using namespace std;
void box(int length, int width, int height);//
void main()
{
box(7,20,4);
box(50,3,2);
box(8,6,9);
}
// box()
void box(int length, int width, int height)
{
cout<< << lengtht* width* height <<endl;
}
return
. .
.
.
.
|
|
++
( );
int
double
char
void ( )
- .
1 2 , 1 2, 2 1.
main(), main() .
1
# include <iostream.h>
void plus (int,int,int); // plus,
void plus1 (int,int,int&); // plus1,
int plus2(int, int) // int
Void main()
{
int a=4; int b=5; int c=10;
cout<<plus()<<endl;
plus(a,b,c);
cout<<c=<<c<<endl; //9
plus1(a,b,c);
cout<<c=<<c<<endl; //10
int c2=plus2(a,b);
cout<<c2=<<c2<<endl; //9
//
cout<<plus2()=<<plus2(a,b)<<endl; //9
}