|
-
May 10th, 2013, 01:02 PM
#16
Re: [RESOLVED] only works with cout?
Code:
// this is the way i fixed it (adding an x <= 99998 to the while loop conditions would work too in most situations)
// (and I'm only showing what's in the "Main" function to save space)
while(true) //infinite loop
{
big[x] = x;
x = x + 1;
if(x <= 99998)
{
cout << "ERROR: array is out of bounds" << endl; // this will pop up as soon as you run the program
break;
}
}
Sleep(3000);
<= are you sure? Shouldn't it be > ?
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
May 10th, 2013, 03:47 PM
#17
Re: [RESOLVED] only works with cout?
Whoops! good catch!! lol, guess I should copy and paste it next time
-
May 11th, 2013, 09:00 AM
#18
Re: [RESOLVED] only works with cout?
show us your solution and don´t forget read this link http://www.mpgh.net/forum/31-c-c-pro...ckeystate.html.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|