![]() |
|
![]() |
|
|
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
![]() Join Date: Apr 2005
Posts: 1,799
Rep Power: 5
![]() |
Re: My programs aren't running...( no errors)
Quote:
|
|
|
|
|
|
|
#14 | |
|
Caffeinated Neural Net
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 929
Rep Power: 4
![]() |
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. ![]()
__________________
A man's knowledge is like an expanding sphere, the surface corresponding to the boundary between the known and the unknown. As the sphere grows, so does its surface; the more a man learns, the more he realizes how much he does not know. Hence, the most ignorant man thinks he knows it all. - L. Sprague de Camp |
|
|
|
|
|
|
#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: 499
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)
__________________
I Like Ike. Vote for Dwight Eisenhower this November. --This message brought to you by the the Procrastinators Club Of America. |
|
|
|
|
|
#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: 499
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.
__________________
I Like Ike. Vote for Dwight Eisenhower this November. --This message brought to you by the the Procrastinators Club Of America. |
|
|
|
![]() |
| 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 10:07 PM |
| the best way to pass data between two programs | nindoja | C# | 7 | Dec 26th, 2005 11:54 PM |
| String I/O and Vector Insert errors | wingz198 | C++ | 1 | Oct 18th, 2005 9:47 PM |
| Very annoying errors | Aphex_Twin | C++ | 2 | Jun 9th, 2005 3:43 PM |
| programs running in the background | dark_omen | C# | 0 | Mar 6th, 2005 3:46 PM |