- you could start the program from a console window (dos prompt)
- you could insert #include <conio.h> at the begin of your source file and _getch(); at end of main
A sincere thanks to all who answered. This has solved the problem with dadabe 's solution.
My apologies to cnoeval. I guessed this had been asked many times, I am not up with the internet that well, as stated in the beginning line, I am a raw beginner. So raw in fact that it hurts. :-)
To my shame, I didn't thank AbR for his valuable input. This also worked a treat. Pity the CIN.GET(); command didn't show in the Dev-Cpp tutorials. Still, it was free and for the most part written very clearly.
No need to apologize for being a newbie and it's a nice touch to post some thanks when you've been helped. 8^)
BTW, most IDEs (i.e. Visual Studio Express Edition which is FREE) provide various ways to hold the console window open for you without have to add extraneous code. Dev-C is very old and no longer supported so if you have the option to upgrade to a better IDE/compiler you will have an easier time coding. Once you learn to use the new IDE of course ;-).
@ dadabe: Good point but most people DO see the console window for a second before it disappears and of course the post was named by the original poster so it's not really fair to change it.
Hello cnoeval,
I got interested in C++ quite a few months ago. I saw a book advertised: "C++ Programming for the absolute beginner"
I ordered it and when it came, the first disappointment came with it. It was written specifically for "Code Warrior V5.0". Well try as I might, noone had heard of this version. The nearest I could get was V5.1. This of course has slightly different syntax ans as such was pretty much useless to me.
That's why I tried the Dev-CPP. Seems like I was a loser both ways :-)
At my age, I don't want to part with any more money, but I will struggle on with what I have.
Thanks again for the input.
Jacko
Hello whitenite1,
like I said... I am a total beginner and ripe for the picking. Didn't know what was what, to start with. That's why I don't want to part company with any more cash, at least not until I get started with C++. Once up and running with something that I am able to refer back to, then I might purchase something a little more upmarket, so to speak. Thank you for your input.
Jacko99
Well, as cnoeval mentioned, Visual Studio Express Edition is free, 2008 or 2010 versions. As for books, try going to your public library, and search for C++ books to borrow. Take a couple out for a couple of weeks, decide which one fits your learning style, and buy it at the store, or when it's time to return it, ask for an extension. If you're lucky, you can go through most of the book in that time, and at no cost. After returning, take out another. Good luck in your programming..
Thanks for that whitenite1, never thought about it that way. Didn't know that visual studio was a free program either. I will go online when I finish this email and get into it.
Hope the syntax isn't too different to the C++ I have been fiddling with, the answer will come as soon as I get started on it. If all turns out well, I will buy a book for future reference rather than travel to the library every time I get the urge to try something different.
Great idea and thanks again,
Jacko99
@Jacko99
I didn't mean for you to have to travel to the library every time you got the urge, but to try out a book or two first, to see if you feel it is helpful in your learning style, BEFORE making a purchase s you don't end up with a book that may be way to easy for you, or, on the other hand, way over your head at the moment. It would like taking a car out for a test drive before making a final decision on a purchase.
And in case you haven't found 'Visual Studio Express' yet, here is the URL of the site. http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express
Good luck on your programming, and you're very welcome..