Adding a pause

Is it possible to add a pause into code. I want to be able to add a pause between certain lines of code
If you want to pause at a specific line for debugging purposes, your debugger should allow you to set "breakpoints."

Otherwise, you have the option of cin.ignore(), like:
1
2
std::cout << "Press ENTER to continue running the program." << std::endl;
std::cin.ignore(std::numeric_limits<std::streamsize>::max(),'\n');
Thank you very much, I will work on this there is just so much to learn
better version is
1
2
3
4
5
6
7
#include<iostream>
#include<cstdlib>
using namespace std;
int main{
cout<<"Example after we want pause";
system("pause");
}

system can be used for all cmd commands
OP, can you tell me why you want to add a pause?
I am trying to teach myself and I have code which makes a statement basically saying the circumference of a circle is c=3.44 x diameter.

I want it to pause there then step by step show the steps to get to the result with a pause after each stage would be nice to press a next button.

Eventually I want to be able to input the data and get a result.

This I find is the best way for me to learn by setting a task and then learning how to achieve it. Eventually I want to be able to run it in a windows environment. with a nice screen etc.

I suppose a flow chart of what I want to achieve would be best
Last edited on
Topic archived. No new replies allowed.