On July 12 2009 16:01 fusionsdf wrote:
honestly I think that's overkill. As long as the programmer is smart enough to assign a value to the variable at some point before use (and hopefully a sanity check), there is no need to have every variable declaration include an assignment.
int a;
double b;
char c;
a = 0;
b = 0.0;
c = cin.get();
cout << a << b << c;
return 0;
There is no point declaring c with an initial value when you are just going to be getting it from the keyboard immediately after anyways.
honestly I think that's overkill. As long as the programmer is smart enough to assign a value to the variable at some point before use (and hopefully a sanity check), there is no need to have every variable declaration include an assignment.
int a;
double b;
char c;
a = 0;
b = 0.0;
c = cin.get();
cout << a << b << c;
return 0;
There is no point declaring c with an initial value when you are just going to be getting it from the keyboard immediately after anyways.
yes, but is a good thing to understand that a variable will have some value always. Anyway i just said him to assign a value to a variable, not to every variable...