Beginners Problem while Learning C++

Thread Starter

sailmike

Joined Nov 11, 2013
147
I'm teaching myself C++ programming from the book "Jumping Into C++". It's a great book so far and makes it easy to learn the language. I'm using Microsoft Visual Studio as the compiler. When I run a simple code the window doesn't stay open long enough for me to read the results. I tried the cin.get(); command, but that didn't work. I've attached the simple code in hopes one of you may recognize a mistake. I was using Code::Blocks through the first 2 chapters, but the program then tried installing malware on my PC, so I deleted that software and went with Microsoft Visual Studio.

Thank you,
MikeJumping Into C++ Problem.jpg Jumping Into C++ Problem 2.jpg
 
In Visual Studio, you can add break points at lines of execution.

Add one at the last bracket "}" and it will stop there after running the program in debug mode.
 
Top