1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
#include <iostream>
using
namespace
std;
int
main()
{
float
a = 1.0f;
cout << (
int
)a << endl;
cout << (
int
&)a << endl;
cout << boolalpha << ( (
int
)a == (
int
&)a ) << endl;
// 输出什么?
float
b = 0.0f;
cout << (
int
)b << endl;
cout << (
int
&)b << endl;
cout << boolalpha << ( (
int
)b == (
int
&)b ) << endl;
// 输出什么?
return
0;
}
|