Thread: Need help with C. Unsure what to do next.

  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    24

    Need help with C. Unsure what to do next.

    I would tell you guys upfront that this is for my assignment. But, all I wanna ask is, how do you make the program go to a certain part of the codes and run from there.

    Here, I want allow the customers to reserve seats at economy class if the business class is full and vice versa.

    The stuff marked with *** is what I don't understand.

    At the same time, if you guys could point out some of my mistakes, I would appreciate it. Attached is my code. Thanks!



    {Thanks for responding. I've managed to get it done but there are still errors. Posted in another thread for help. Thanks again for responding}
    Last edited by zenghoong; 10-12-2009 at 03:10 AM. Reason: Got my answer.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Generally speaking, eight consecutive closing braces means you're doing something badly. It seems rather bizarre to have this sort of structure going on, and in fact it prevents you from what you want to do, since there's no way of getting to the code for the economy section from the code for the business section should that section be full. It's not as though you're really doing so many different things here -- no matter what menuselection2 comes out to be, for instance, you always then give menuselection3.

    All in all, this seems like a job for flags -- rather than having separate blocks of code for each possible set of choices, just set selected_class = business; or something similar, and then you can easily adjust if full.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. New to Forms/MFC. Unsure where to place the code.
    By Swerve in forum Windows Programming
    Replies: 1
    Last Post: 02-02-2009, 01:15 AM
  2. Unsure on how to approach this concurrency problem
    By osiris^ in forum C# Programming
    Replies: 3
    Last Post: 04-29-2008, 11:47 PM
  3. unsure about auto/smart pointers
    By l2u in forum C++ Programming
    Replies: 16
    Last Post: 07-13-2007, 12:55 PM
  4. Unsure of how to properly use extern "C"
    By INFERNO2K in forum C++ Programming
    Replies: 5
    Last Post: 11-11-2005, 11:54 AM
  5. Little Unsure?
    By kas2002 in forum C Programming
    Replies: 8
    Last Post: 06-12-2002, 08:18 PM