g*******g 发帖数: 431 | 1 初学 看了两天了。。。还是不明白。。哎啊
#include
using namespace std;
int a ( );
void b (int = 5);
float c (int&);
int main()
{
int y, x = 2;
float z;
y=a();
cout << x << " "<< y << endl;
b();
z = c(x);
cout << x << " "<< y << " " << z <
b(x);
cout << x << " " << y << endl;
return 0;
}
int a ( )
{
int x = 1;
x += 3;
return x;
}
void b(int y)
{
static int x = 4;
x = x + y;
cout << x << endl;
}
float c(int & x)
{
x *= 2;
cout << x << endl;
return 3.0;
} |
g*******g 发帖数: 431 | 2 return 0 是没有error吧。。。
return 3 是什么意思啊 。。 。 |
g*******g 发帖数: 431 | |
h*******y 发帖数: 1563 | 4 default 初始化 和赋值初始化
【在 g*******g 的大作中提到】 : b() 和b(x)有什么区别阿。。哭了
|
h*******y 发帖数: 1563 | 5 没什么意思,就是return 3
【在 g*******g 的大作中提到】 : return 0 是没有error吧。。。 : return 3 是什么意思啊 。。 。
|
g*******g 发帖数: 431 | 6
多谢大侠,能不能看看这个答案对不对?
2 4
9
4
4 4 3.0
8
4 4
【在 h*******y 的大作中提到】 : 没什么意思,就是return 3
|