Recent content by VirObitus

  1. V

    How can I fix the problem I'm having with break in my code?

    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...
  2. V

    How can I fix the problem I'm having with break in my code?

    Whoops, I said something stupid. Yeah, that looks as if it should work
  3. V

    How can I fix the problem I'm having with break in my code?

    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.
  4. V

    How can I fix the problem I'm having with break in my code?

    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 ||...
  5. V

    How can I fix the problem I'm having with break in my code?

    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...
  6. V

    How can I fix the problem I'm having with break in my code?

    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.
  7. V

    C/C++ Troubleshooting a Simple C++ if/else Question for New Programmers

    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...
  8. V

    How can I fix the problem I'm having with break in my code?

    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...
  9. V

    Looking to become a decent programmer Any advice?

    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...
  10. V

    Need help with windows app functions in C

    Right. I ended up converting it to a string and using MessageBox. Problem solved.
  11. V

    Need help with windows app functions in C

    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...
  12. V

    A for loop to set a 2D array in C

    aha, I fixed it. Thanks for the help!
  13. V

    A for loop to set a 2D array in C

    yes, char option[70], so sizeof(option) should be 70
  14. V

    A for loop to set a 2D array in C

    the file I am reading is a .txt file, and its in the format: Fine. OK. Never been better! etc. None of the lines are over 70 characters currently.
  15. V

    A for loop to set a 2D array in C

    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...
Back
Top