Page 1 of 1

Getting the output of an C++ Application!!!

Posted: Sat Jun 27, 2009 9:56 am
by varuna
The preferences settings I used in running a C++ Application are
Parameters:-$BaseName
Initial folder:-FileDir

If I compile the following program and run, at the first time of execution the out put is "Press any key to continue" and only when for the second time the program is run the intended output is given.Why is this and how can I correct this?

Code: Select all

#include <stdio.h>
int main(void)
{
	printf("Hello world\n");
	printf("Hit any key to continue:");
	getchar();

return 0;
}