error

What does this error mean.
C:\Users\Desktop\New folder\2cdcalc\main.cpp|20|warning: 'total' is used uninitialized in this function|
Last edited on
total is being used before it has been initialized.
you have to do either
int total = random_number;
or...
int total;
cin>> total;
note on the last one you cannot use it until the cin line occurs unless you initialze or set total to a number like this but usually this would be in a loop where the first time it would be a 0 and the seccond time it'd be whatever they wrote
int total=0;
//use total
cin >> total;
Topic archived. No new replies allowed.