+ 1
What is temp ?
double temp = 4.25;
3 ответов
+ 4
Temporary variables are usually named "temp". It's just like any other name and doesn't affect the variable and is only for readability.
In your case it's a variable of type double initialized to 4.25.
+ 2
temp is a variable of type double.
+ 1
Try to avoid variable names like temp though, unless absolutely necessary. Variable names should be human readable.
e.g. car_colour = 'red'
rather than c = 'red'
This makes the code more readable and therefore reduces the probability of bugs, and makes the code more maintainable.