What is the difference between declaring each variable with a type and declaring multiple variables of the same type? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the difference between declaring each variable with a type and declaring multiple variables of the same type?

int a; int b; int c; int a, b, c;

23rd Jul 2019, 10:59 PM
Elmer Martens
Elmer Martens - avatar
2 Answers
+ 2
There's no technical difference, just a matter of preference
23rd Jul 2019, 11:19 PM
Dlite
Dlite - avatar
+ 1
You can minimize the length of your code
24th Jul 2019, 1:03 PM
Rᴀ.Oɴᴇ
Rᴀ.Oɴᴇ - avatar