由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - 请教一道入门小题
相关主题
小白请教一个C++问题:问什么我不能把两个指针=起来?C++疑问
为什么我看不懂下面的code,是不是水平还不够?two c++ interview questions! (转载)
compare double to float请教一个作用域的问题
大家来做题C++。[合集] C++问题(copy constructor)
题2问一个简单的C++问题
a simple question for C++ class一个指向指针的指针的引用?
请问一个exception题目问个char*的问题
两个继承问题数组弱问
相关话题的讨论汇总
话题: int话题: endl话题: cout话题: float话题: return
进入Programming版参与讨论
1 (共1页)
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
3
b() 和b(x)有什么区别阿。。哭了
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
1 (共1页)
进入Programming版参与讨论
相关主题
数组弱问题2
[合集] 关于构造函数a simple question for C++ class
C++菜问: 怎么这样也可以?请问一个exception题目
c++之极弱问两个继承问题
小白请教一个C++问题:问什么我不能把两个指针=起来?C++疑问
为什么我看不懂下面的code,是不是水平还不够?two c++ interview questions! (转载)
compare double to float请教一个作用域的问题
大家来做题C++。[合集] C++问题(copy constructor)
相关话题的讨论汇总
话题: int话题: endl话题: cout话题: float话题: return