![]() |
|
#1
|
|||
|
|||
A penny to the first person that can show me my errorHi, I'm kind of a novice C++ programmer right now. I'm not completely new to programming, but its been quite a few years without any real coding. I've worked with, and in, other scripts, just adding a line here or there, but nothing serious. I have some plans for the future however, that I thought it was best if I seriously learn how to program, and start over from scratch. So, I've been just working my way through a few C++ beginner books for the last few days to get a refresher and then hopefully move onto some more advanced books.
Anyway, I've looked and re-looked at the code for this very simple program and I simply can't find anywhere that it differs from the code in the book, or why it doesn't work. I must have a typo in there somewhere. I just can't for the life of me, see it. The program compiles fine. But after it collects the user input, it just sits there and doesn't ever do anything else. CPP / C++ / C Code:
Last edited by admin : 12-Mar-2009 at 22:25.
Reason: Please insert your example C/C++ codes between [CPP] and [/CPP] tags
|
|||
|
#2
|
|||
|
|||
Re: A penny to the first person that can show me my errorQuote:
Try changing this: CPP / C++ / C Code:
to this CPP / C++ / C Code:
Regards, Dave Footnotes: 1. You can make the program tell you what it is doing with something like: CPP / C++ / C Code:
or some such thing. You can see that it really is doing "something." Just not what you had in mind! 2. As a matter of style, why the heck didn't you call it something like "product" instead of "sum"? Or is it from the book? Did the book call it "sum"? I wonder why. Maybe it's not important to you, Maybe not now, but... 3. A penny? What? And lose my amateur status? No thanks. Use it to buy yourself and your Significant Other a treat. Take a trip. See a show. Last edited by davekw7x : 12-Mar-2009 at 13:39.
|
|
#3
|
|||
|
|||
Re: A penny to the first person that can show me my errorAhh, thank you, there was my typo. damn 1's and i's look too similar sometimes.
And yes, using sum is just what the book did. I'm trying to be a good little student and follow along exactly, for now. And thanks as well for the penny back. I think I'll invest it in the stock market. I should be able to get a few hundred shares of GM or something these days with it. |
Recent GIDBlog
Accepted for Ph.D. program by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Two-Tier data dissemination code installation problem | nidhibansal1984 | Computer Software Forum - Linux | 6 | 16-Sep-2007 11:13 |
| Linked Lists advice request | promsan | C Programming Language | 74 | 23-May-2007 09:29 |
| Major newbie problem | cynack | MS Visual C++ / MFC Forum | 1 | 08-Apr-2007 12:25 |
| Winsock error when compiling FLTK 2.0 Projects | mauriciorossi | FLTK Forum | 3 | 16-Aug-2005 11:18 |
| Help with syntax errors | PeteGallo | C Programming Language | 7 | 08-Aug-2005 21:30 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The