Thread: Beginner, help with loop and variable

  1. #16
    Registered User
    Join Date
    May 2012
    Posts
    11
    The thing is I'm very new at this, like five days worth of new, and goto was the only thing I could find that made sense for the time being. I realize it was warned against. Do you have a suggestion as how to go about it? I'm a fan of constructive criticism, the more the better.

  2. #17
    Registered User
    Join Date
    Dec 2011
    Posts
    795
    Do-whiles are the best constructs for input such as this:

    Code:
    int d; /* make sure it's within scope */
    do {
        /* do your printing here */
        d = GetInt();
    } while (d < 28 || d > 31);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Beginner Problem with Loop
    By ToweyLeake in forum C++ Programming
    Replies: 4
    Last Post: 10-11-2011, 10:12 AM
  2. beginner loop help
    By helloalyssa in forum C++ Programming
    Replies: 3
    Last Post: 10-25-2010, 09:08 PM
  3. Replies: 10
    Last Post: 03-28-2010, 01:35 AM
  4. Replies: 4
    Last Post: 11-15-2005, 02:13 PM
  5. trouble with a loop (beginner)
    By Procta in forum C++ Programming
    Replies: 2
    Last Post: 12-04-2003, 10:27 AM

Tags for this Thread