1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| #define _CRT_SECURE_NO_WARNINGS #include <iostream>
using namespace std;
void printX(const int & re ) { cout << "re " << re << endl; }
int main(void) { const int a = 10; const int &b = a;
int x = 3.14; const int &re1 = x;
cout << "re1 " << re1 << endl; x = 20; cout << "re1 " << re1 << ", x: " << x << endl;
const int &re2 = 10;
cout << "re2 = " << re2 << endl;
cout << "sizeof(re2)" << sizeof(re2) << endl;
return 0; }
|