HI
every time I try to debug this program in Microsoft Visual C++, I get a pop up that says ---->
"Run-Time Check Failure #3 - The variable 'count' is being used without being initialized."
and it asks if I want to break or continue the program. Can someone please tell me what I'm doing wrong? I get this message in all of my while statements.
int count; //count not initialized
int val; //val not initialized
srand (time(NULL));
val = rand() % 100+1; //val is initialized
while (count != val) ... //count still not initialized
two solutions:
since val is a random number. initialize count with 0, val-1 or something like this, so count is != val (or else you will not enter the loop)
or
(i would do this), since you will initialize count in your loop via cin, use a do while loop.