| | |
Pressing a Button makes a new thing
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
So How Do you want to exit from the program.
Let us assume that You want to exit when you press 'x';
so
That would be the appropriate code.
What was wrong with you code was that the while loop was only focused on one single action
Let us assume that You want to exit when you press 'x';
so
C++ Syntax (Toggle Plain Text)
char action; while(action!=x) { cin>>action; switch(action) { case 'c': case 'C': //do something over here; } }
What was wrong with you code was that the while loop was only focused on one single action
Then you're making it yourself difficult, but why don't you just get the whole line of 'c's first? The only thing left then is count how many times the 'c' occurred and use dynamic memory allocation to allocate the appropriate amount of memory for it ...
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
•
•
•
•
Then you're making it yourself difficult, but why don't you just get the whole line of 'c's first? The only thing left then is count how many times the 'c' occurred and use dynamic memory allocation to allocate the appropriate amount of memory for it ...
Black Star Uses character based input and not string based because, Its like a real Shop Scenario.
WHERE CUSTOMERS CAN arrive at any point of time.
•
•
•
•
I think that using vector of customers would be more appropriate for this .

I finally fully understand what he's trying to do, in this case using vectors is definitely the way he should go !!
Last edited by tux4life; May 10th, 2009 at 4:21 pm.
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
Last edited by tux4life; May 10th, 2009 at 4:25 pm.
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
![]() |
Similar Threads
- computer revs when holding start button (Troubleshooting Dead Machines)
- How do you load a code from pressing another button? (Pascal and Delphi)
- please help computer will not start (Troubleshooting Dead Machines)
- Frequent "Page cannot be..." and slow performance. Please read. (Viruses, Spyware and other Nasties)
- Gigabyte 939 (Motherboards, CPUs and RAM)
- repeating the whole program after pressing Yes button in the confirmation message box (Java)
- need feedback on my new flash site (Website Reviews)
- More Printer Problems (USB Devices and other Peripherals)
Other Threads in the C++ Forum
- Previous Thread: I got stuck on loading the matrix from file
- Next Thread: A problem with dynamic allocation..help please
| Thread Tools | Search this Thread |
api array beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion count data database delete desktop developer directshow dll download dynamic email encryption error file forms fstream function functions game getline google graph gui homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates test text text-file tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






