Not really Dave. I've already finished reading the file by the time this function is called, its just testing the results of the file that it read against another array. traitCount just holds the number of entries in the file, so that the program knows when to stop. It doesn't manipulate the...
As I said above, the last code I posted is working correctly, no need to debug it (unless your talking about the for loop?). Just curious if there is a way to do that without using break. traitCount is set by reading a file, and is set to the number of lines in the file.
Ok, I had a hell of a time troubleshooting this thing, and if anyone is interested, this is how I finally got it to work. However, it still uses break, which I am told is 'bad programming', so if anyone can show me a way to avoid it I would be grateful. I tried " for (i = 0; i < traitCount ||...
Nah, the problem isn't the variables, that would cause a compile error (that was just me not paying attention when i posted them) The full source is about 500 lines, so I would rather not post the entire thing. I've troubleshot(sp?) the rest of the program, and it compiles and run fine, and...
Aha, thank you for pointing that out... stupid mistake. The success test in the for loop is a great idea, I didn't even think of that, thanks.
However, the problem still remains... except now it just always selects the first choice.
In other words, write it like this:
if (a < 10)
{
y = a*b*c;
cout << "blah blah" endl;
}
else
{
y = a+b+c;
cout << "blah blah" endl;
}
The use of the curly brackets and indentation really helps you keep track of what's going on, especially when you are using...
Hi again,
I *think* I am having a problem with break, as I can't figure out why I am having the problem I am having. This code is meant to compare 24 integer 'traits' against 48 minimum and maximum values, and if all 24 fit within their respective min and max value, to exit the loop. If the...
If you want to make games, but don't want to learn a somewhat difficult language (like C), try game maker by yoyo games. I am taking game design classes at a private university, and that's what they start with, while your learning C and C++. Gamemaker also helps you understand event driven...
Hello folks,
Ok, I've been doing windows application tutorials, and I can make a mean dropdown list and dialog box, but I have no idea how to get the windows app to use a function. Say I just want a dialog box to pop up and use the function:
int myFunction ()
{
int i = 1;
return i...
for some reason when I check responseLoop values after doing any of the above suggestions, or my original code, the values are either 0's or are in the 200,000's. I am initializing them at those numbers (0,200...) and don't change their values or even use responseLoop anywhere else in the...