Is there a way to pause your program while it's running?

closed account (zN0pX9L8)
Is there a way to pause your program while it's running?
Are U searching for system("PAUSE") kind of thing???
Last edited on
I would hook your program to a debugger and use breakpoints. This would allow you to inspect the code and variable values while it's running.

A good multi-platform debugger is GDB.
closed account (z05DSL3A)
Two interesting answers to a lovely vague question.

How To Ask Questions The Smart Way:
http://www.cplusplus.com/forum/articles/1295/
Use the system("pause>nul"); line to pause it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "stdafx.h"
#include <iostream>
using namespace std;

int _tmain()
{
	// declaring variables:
	int a, b;
	int result;

	//print out the result:
	cout << " Hello World! ";
	//terminate the program:
	
	system("pause>nul");
	return 0;
}
Topic archived. No new replies allowed.