![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 | |
|
Newbie
Join Date: Dec 2007
Posts: 16
Rep Power: 0
![]() |
Re: My programs aren't running...( no errors)
Quote:
|
|
|
|
|
|
|
#12 |
|
Programmer
Join Date: Oct 2007
Posts: 39
Rep Power: 0
![]() |
Re: My programs aren't running...( no errors)
You don't need other 'inputs'. Stop the program as suggested with cin.get()
__________________
Testing 001 010 011 100.... |
|
|
|
|
|
#13 | |
|
Programming Guru
![]() ![]() |
Re: My programs aren't running...( no errors)
Quote:
__________________
Looking for tough programming challenges? Try participating in Sane's Monthly Algorithms Challenges! Composing Techno is a little side hobby of mine. Techno by DJ Sane. All free for download. |
|
|
|
|
|
|
#14 | |
|
Caffeinated Neural Net
![]() Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 1,122
Rep Power: 5
![]() |
Re: My programs aren't running...( no errors)
Quote:
void main() in examples and what not.In fact, there is a term for his work: bullschildt. ![]()
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot. - Vaarsuvius, Order of the Stick |
|
|
|
|
|
|
#15 |
|
Newbie
Join Date: Dec 2007
Posts: 16
Rep Power: 0
![]() |
Re: My programs aren't running...( no errors)
First of all, LOL. "bullschildt," I love it. Well, he's sold over a quarter-million books and he seems to be respected in the community by some people atleast. Also, I did try
cin.get() ) and I hope someone can find out why this is happening, I'm trying to all the time. Maybe it's the settings? |
|
|
|
|
|
#16 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Re: My programs aren't running...( no errors)
Methinks that code was given to you under the impression that you had a different problem to what you do have. Have you taken in Sane's advice and corrected it? What errors are you being given by your compiler/IDE?
|
|
|
|
|
|
#17 |
|
PFO God In Training
![]() Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 598
Rep Power: 4
![]() |
Re: My programs aren't running...( no errors)
The proglem is that when you use cin to input an integer the '\n' (Enter key) remains in the keyboard buffer, so you have to remove it or the next cin will fail. I solve this by adding cin.ignore(). after each cin. This is not a foolproof solution -- you can still break the program by typing junk characters after the number you want to enter and before hitting the Return key.
Here is a working program using Dev-C++ compiler. cplusplus Syntax (Toggle Plain Text)
|
|
|
|
|
|
#18 | |
|
Programmer
Join Date: Oct 2007
Posts: 39
Rep Power: 0
![]() |
Re: My programs aren't running...( no errors)
Quote:
cin.get() is what he needs to do.Yeah, for input. He still needs cin.get() at the end of the program. So far, as far as we can tell, nothing has changed since we have no idea what if anything has been added to his program. Let's stop guessing and wait for him to show us what he's done and what problems still exist, if any.
__________________
Testing 001 010 011 100.... |
|
|
|
|
|
|
#19 | |
|
Newbie
Join Date: Dec 2007
Posts: 16
Rep Power: 0
![]() |
Re: My programs aren't running...( no errors)
Quote:
cin.ignore();
__________________
Aspiring Game Designer |
|
|
|
|
|
|
#20 |
|
PFO God In Training
![]() Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 598
Rep Power: 4
![]() |
Re: My programs aren't running...( no errors)
Not that severe and nothing that can't be easily fixed. The only problem I've had so far is that I had to go into the tools-->compiler options-->directories tab and add the full path to all include and lib paths. I have yet to successfully compile and link a DLL, but its probably something simple too.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Valgrind reports errors with basic programs | Jessehk | C | 4 | Feb 24th, 2007 11:07 PM |
| the best way to pass data between two programs | nindoja | C# | 7 | Dec 27th, 2005 12:54 AM |
| String I/O and Vector Insert errors | wingz198 | C++ | 1 | Oct 18th, 2005 10:47 PM |
| Very annoying errors | Aphex_Twin | C++ | 2 | Jun 9th, 2005 4:43 PM |
| programs running in the background | dark_omen | C# | 0 | Mar 6th, 2005 4:46 PM |