![]() |
|
#1
|
|||
|
|||
Teach Yourself in 24 Hours?Hello all! I'm just starting out with that book called Sams Teach Yourself C++ in 24 Hours, Third Edition. Anyways I had a question... I'm on hour 3 now and so far every program they have you make, like that first "Hello World" one, dont run right I dont think. I compile them and all without any errors but when I go to run them they just pop up REAL FAST and then close... I mean you can bearly see that it even opened because it closes so fast! Is this whats supposed to happen?
Thanks |
|
#2
|
|||
|
|||
|
I found this, but I still dont know what the heck to do.
Here is what I found in some help file.... 2. When executing my dos program, it closes automatically. How I can change this ? You can use an input function at the end of you source. The following code is an example for asking the user to press Enter to continue: CPP / C++ / C Code:
And this is the Hello.cpp file I have..... CPP / C++ / C Code:
What do I do? Thanks. |
|
#3
|
|||
|
|||
|
You are working in a Windows world. Double-clicking an executable you've made runs it in a command prompt (because it's a simple app, which writes to cout only), but if it finishes, Windows closes it.
What you've to do is work in a DOS world. Open a DOS prompt, cd to the directory the executable is held, and type it's filename there. Then you'll see it's output on screen, and it won't disappear. What's been suggested in the help page you read, is to force the program to wait for input - the puase() function waits for a keypress - before the program will quit - and Windows will close the DOS prompt. GF |
|
#4
|
|||
|
|||
|
Hey! Thanks for your help!
I did it with the pause function... Is that OK? And also, will this book really teach me how to be a good programmer? Thanks. |
|
#5
|
|||
|
|||
|
Whatever does the job for you!
Hate to sound like a dodgy guru (I am NOT a guru), but experience will make you a good programmer. When you become experienced, look up books on Data Structures & Algorithms, which will intorduce you to new & clever ways of solving problems. GF |
|
#6
|
|||
|
|||
|
Alright thanks. I'm only on hour 4 in that book right now and it's getting really hard for me to understand.
Can you just give me some examples of programs I will be able to write after I learn C++? Thanks. |
|
#7
|
|||
|
|||
|
Hmmm, examples? Well imagine any computer program you use. In theory, you'd be able (with a lot of work) to write that.
After I did my course in C++ programming & programming theory, I could write a simple database program, taking very simple SQL statements. I could make a high precision calculator program. We even created our own programming language - we coded a parser, like PHP. I've not used any Visual C++ tools, I stick with a gcc compiler. I prefer making programs that do what I want, instead of looking pretty. GF |
|
#8
|
|||
|
|||
|
Thanks. So what would I have to learn to "make them look pretty"?
|
|
#9
|
|||
|
|||
|
I'm unsure about that book, I don't think it goes into GUI design.
There are programs out there, like Microsoft Visual C++ which contains a WYSIWYG interface design, and allows you to write the code which interacts with these. So you can make a professional progra, with toolbars, buttons, dialogas and hopefully, with your work, some good functionality. There are plenty of books out there which go into C++ with GUIs, so surf around. GF |
|
#10
|
|||
|
|||
|
Yes I will. I just need to see how this book goes first though. I guess pretty much when you know this book inside out you’re considered a novice and it’s already been about 1/2 a week and I just finished hour 6 which completes Part I, named "Introducing C++"
I mean I know its going to be tough, I didn’t even understand a lot of stuff in these first 6 hours so now I need to go back to hour 1 and start all over again to read part I a second time before I get into Part II and hopefully I will know exactly what is going on... if not I guess I'll need to try a third time |
Recent GIDBlog
Toyota - 2008 September Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Payroll program | arek | C Programming Language | 0 | 23-Sep-2003 18:20 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The