hi, im new to programing and im starting with c++. can someone please tell me what the best compiler is (in your opinion). i have dev c++ but it doesn't work with the source code that is written in a book that i am reading called "Sam's teach yourself c++ in an hour a day".
First, I'd suggest that you move from Dev-C++ to either wxDev-C++ or Code::Blocks. Dev-C++ is a fossil. :|
Second, this isn't a problem with Dev-C++'s included compiler. It's an issue with Dev-C++ itself. It closes the console as soon as the program finishes, rather than pausing it automatically after the program is finished.
Third, please try to avoid using system() unless you can justify it perfectly. Duoas wrote up a pretty good article about why you should avoid the function when possible; if you check the Articles section of this forum, one of the stickied threads has a link to it. Also, there's a thread stickied at the top of this forum about how to keep the console open.
Dev-C++ doesn't keep the console window open after the program terminates, that's all.
You shouldn't use Dev-C++ for various reasons, mainly because it is outdated.
Uninstall it, then go to the folder it was installed to and delete everything that is left to get rid of the outdated version of the compiler that comes with it.
The book you have is not to be recommended. If its author is Liberty, then it is a heavily abridged version of Teach Yourself C++ In 21 Days, which is a pretty bad book in itself.
You should either buy a decent book such as the C++ Primer or if you don't want to spend more money, you can read the "Thinking in C++" e-book: http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html