This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
|
cpp:basic_data_types [2019/04/12 08:37] gthanos [Αυτόματη εξαγωγή τύπου δεδομένων] |
cpp:basic_data_types [2021/04/25 14:39] gthanos [Αυτόματη εξαγωγή τύπου δεδομένων] |
||
|---|---|---|---|
| Line 50: | Line 50: | ||
| int b(3); // initial value: 3 | int b(3); // initial value: 3 | ||
| int c{2}; // initial value: 2 | int c{2}; // initial value: 2 | ||
| - | int result; | + | |
| a = a + b; | a = a + b; | ||
| - | | + | |
| - | cout << | + | b = a - c; |
| + | cout << | ||
| return 0; | return 0; | ||
| Line 73: | Line 74: | ||
| long b(3); // initial value: 3 sizeof long | long b(3); // initial value: 3 sizeof long | ||
| - | auto result = a + b; // compiler automatically extracts the result' | + | auto result = a + b; // compiler automatically extracts the variable |
| - | cout << result << | + | |
| + | cout << | ||
| + | cout << " | ||
| + | cout << " | ||
| return 0; | return 0; | ||
| Line 92: | Line 96: | ||
| decltype(b) result; | decltype(b) result; | ||
| - | result | + | |
| - | cout << | + | cout << |
| + | cout << " | ||
| | | ||
| return 0; | return 0; | ||