blob: 6e958d23b8f6c60b34365c133e363792f32054b7 (
plain)
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
|
#include <iostream>
/*
*
* 2.35
*
*
*/
int main () {
const int i = 42; // const int
auto j = i; // int
const auto &k = i; // const int&
auto *p = &i; // pointer to const int? (const int*) or pointer to pointer?
auto p2 = &i;
const auto j2 = i, &k2 = i;
// const int // reference to const int (const int&)
std::cout << i << "\n"
<< j << "\n"
<< k << "\n"
<< p << "\n"
<< p2 << "\n"
<< j2 << "\n"
<< k2 << std::endl;
return 0;
}
|