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