Beginner, help with loop and variable

This is a discussion on Beginner, help with loop and variable within the C Programming forums, part of the General Programming Boards category; The thing is I'm very new at this, like five days worth of new, and goto was the only thing ...

  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);

Page 2 of 2 FirstFirst 12
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, 01:13 PM
  5. trouble with a loop (beginner)
    By Procta in forum C++ Programming
    Replies: 2
    Last Post: 12-04-2003, 09:27 AM

Tags for this Thread


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