1st Sep 2020, 2:30 PM
Infinity
Infinity - avatar
3 odpowiedzi
+ 6
add columns int x = (1, 2, 3); // x = 3 or if you want array int x[] = {1, 2, 3};
1st Sep 2020, 2:33 PM
nicolas turek
nicolas turek - avatar
0
Why does x = (1,2,3) takes the last value? i.e x = 3
1st Sep 2020, 3:35 PM
Infinity
Infinity - avatar
0
Because ',' is working in different way than in functions - it process first part, than second - it's priority in operators is last, so you have to add columns because 2 and 3 aren't correct name for intager (can't start with number), normaly ',' is used to declare more variables at time int x = 5, y = 7; // creates two intagers, x and y here you can see it: https://code.sololearn.com/c8Aw5E9nwM2l/?ref=app
2nd Sep 2020, 2:50 PM
nicolas turek
nicolas turek - avatar