Thread: please help, infinite loops!

  1. #16
    Grammar Police HybridM's Avatar
    Join Date
    Jan 2003
    Posts
    355
    Well thanks for the help but i think i'll have to abandon the idea and try something else.

  2. #17
    DarkElfe
    Guest
    Hello,

    For the infinite loop, try replacing the line
    Code:
    cin.getline(pointchoi, 3, '  ')>>points2;
    by that one :
    Code:
    cin >> pointchoi >> points2;
    It seems that the first line keeps the ending char in the input stream so that the next iteration puts ' h' (or ' m') in pointchoi.

  3. #18
    Grammar Police HybridM's Avatar
    Join Date
    Jan 2003
    Posts
    355
    Hey, i have gone and done something different now, but i've certainly learnt my lesson.

    Your explanation makes sense, thank you.

  4. #19
    Registered User
    Join Date
    Jan 2003
    Posts
    38
    Games are a bit hard to grasp at first.... But actually wacthing people play a game you made makes yea go yea it works... kinda... well ... ok so ... hrmmm... programming games is SO much harder than anything else.... There will always be errors in the code just like any major company will tell you.... I programmed a game I dont remember why but it kinda works tho I didnt use classes... only functions I will send yea the cpp if you want just drop me a line at my e-mail and ask for it.... you may be able to use some of it hehe

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Infinite Loops in C
    By DaniiChris in forum C Programming
    Replies: 8
    Last Post: 07-06-2008, 12:21 PM
  2. Infinite While Loops Question
    By hern in forum C++ Programming
    Replies: 4
    Last Post: 08-13-2005, 07:27 PM
  3. i have infinite loops. why?
    By hermit in forum C Programming
    Replies: 20
    Last Post: 04-17-2002, 06:58 AM
  4. help with arrays and loops
    By jdiazj1 in forum C Programming
    Replies: 4
    Last Post: 11-24-2001, 04:28 PM