+ 2
Im just a stupied question: declaring runtime
Is there a difference between the runtime of declaring a variable and give it a value in the same line (int x = 5;), and declare a variable and give it a value in another row (int x; x=5;)?
3 Answers
+ 10
There is no difference , Because you declared x as a variable and in variables you can declare the variable in a line and then assign a value to it in another line or you can declare it and assign value to it in the same line :)
+ 6
doesn't matter but if you had to declare 4-5 variables in that case declaring on another line is easy.
int a,b,c,d,e;
a = 0;
b = 1;
like this.
+ 1
thanks!