Problem with cin

This is a discussion on Problem with cin within the C++ Programming forums, part of the General Programming Boards category; Hiya people! I'm quite newbie to C++ but i know the really basic basics. A couple of days ago i ...

  1. #1
    Pygmy Monkey ErionD's Avatar
    Join Date
    Feb 2002
    Posts
    408

    Unhappy Problem with cin

    Hiya people!
    I'm quite newbie to C++ but i know the really basic basics.
    A couple of days ago i tried making a small RPG game just for the fun of it.
    I started making a small character creator which consisted of a few couts and a couple of cins.
    I was overwhelmed by happiness when there were no error messages.
    But when i tested it i could only write in the first of the cins then the program skipped the rest of them.
    Why?
    Attached Files Attached Files

  2. #2
    Registered User CompiledMonkey's Avatar
    Join Date
    Feb 2002
    Location
    Richmond, VA
    Posts
    438
    You can make a small RPG with just some simple C++ stuff? Cool!

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Here's a quick rewrite.....

    I have simplified much of it, moved the variable declarations to the top (as none of them are conditionals), changed charectors into strings, added a strcmp() function to test if a string is "yes", changed the if logic to switch cases and added contine and break statements to control the program flow a little better.

    It still isnt the best RPG in the world (), but it may give you a few ideas on where you were falling down
    Attached Files Attached Files

  4. #4
    Pygmy Monkey ErionD's Avatar
    Join Date
    Feb 2002
    Posts
    408
    Yay thanks man =D

    I haven't come to that level of programming yet but i'll review it with some help from my C++ book and perhaps i'll get some understanding vibes...
    Big thanks to you!
    Now the only question that remains is which company to send this RPG to when its done.... maybe like....Square Soft Inc......

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Words and lines count problem
    By emo in forum C Programming
    Replies: 1
    Last Post: 07-12-2005, 03:36 PM
  2. Problem with cin. Please help me.
    By Antigloss in forum C++ Programming
    Replies: 17
    Last Post: 06-06-2005, 09:50 AM
  3. Input File HELP, weird problem
    By gravity-1 in forum C++ Programming
    Replies: 5
    Last Post: 03-29-2005, 07:43 PM
  4. half ADT (nested struct) problem...
    By CyC|OpS in forum C Programming
    Replies: 1
    Last Post: 10-26-2002, 08:37 AM
  5. binary tree problem - help needed
    By sanju in forum C Programming
    Replies: 4
    Last Post: 10-16-2002, 05:18 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21