cpp:basic_data_types
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth 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; |
cpp/basic_data_types.txt · Last modified: 2021/04/25 14:02 (external edit)