indentifier question

hello I have a question,
when do we use
double value=0.0;

and when do we use
double value;


or what is the difference ?
Last edited on
The former initializes value to zero, the latter doesn't.
do you mean the value is constant as zero
what if the user input something else
"Initializing" means "setting something to some initial value". It doesn't mean "permanently setting something to some initial value".
do you mean that in this case the value cannot be less than zero ??
int a=0;

?
No helios means it sets the value to zero. Nothing more, nothing less. It can be changed because it is not a constant.
what is the use to assign a value for it, altough we know that the users are going to change it ?
That's not always a certainty.
Example:
1
2
3
4
int a=0, average=0;
for (;v[a]!=0;a++)
    average+=v[a];
average/=a;
I didn't get . please explain in words
Topic archived. No new replies allowed.