Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. multiple run

multiple run

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zakria81
    wrote on last edited by
    #1

    Hi, this is a main class for a program that I have and I want it to be a multiple run, to ask the user if he wants to enter another number #include #include #include "postalobj.cpp" using namespace std; int main() { int num; postalclass pobj; cout<<"Please enter the number of mailboxes for the Postal problem : "; cin>>num; pobj.setnumbox(num); pobj.process(); getch(); }

    A 1 Reply Last reply
    0
    • Z zakria81

      Hi, this is a main class for a program that I have and I want it to be a multiple run, to ask the user if he wants to enter another number #include #include #include "postalobj.cpp" using namespace std; int main() { int num; postalclass pobj; cout<<"Please enter the number of mailboxes for the Postal problem : "; cin>>num; pobj.setnumbox(num); pobj.process(); getch(); }

      A Offline
      A Offline
      Avi Berger
      wrote on last edited by
      #2

      zakria81 wrote:

      I want it to be a multiple run, to ask the user if he wants to enter another number

      You need to: a) Put in a loop. Since it should always execute at least once, a do {} while(); might be appropriate. b) In the loop ask the user if he wants to enter another number. Based on the response, terminate the loop or continue looping. This should be straightforward.

      Please do not read this signature.

      Richard Andrew x64R 1 Reply Last reply
      0
      • A Avi Berger

        zakria81 wrote:

        I want it to be a multiple run, to ask the user if he wants to enter another number

        You need to: a) Put in a loop. Since it should always execute at least once, a do {} while(); might be appropriate. b) In the loop ask the user if he wants to enter another number. Based on the response, terminate the loop or continue looping. This should be straightforward.

        Please do not read this signature.

        Richard Andrew x64R Offline
        Richard Andrew x64R Offline
        Richard Andrew x64
        wrote on last edited by
        #3

        Avi Berger wrote:

        Please do not read this signature.

        My eyes!!! :omg:

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups