cout error

No matter how many times I compile or run, "hello world" is not printed, but another program using the same compiler on the same system runs cout. Whats the error. Your help will be much appreciated. I am using DevC++ 5.10.


1
2
3
4
5
6
7
8
9
10
  #include <windows.h>
#include <iostream>
using namespace std;
int main()
{
	cout<<"hello world";
	system("pause");
	return 0;
}
Try using endl (it will flush the stream).

 
cout<<"hello world" << endl;
remove line 1 and 7.
enter a _getch(); over return 0; and delete the #include <windows.h> and system("pause");

Then it works :)
@Peter87 Tried as your suggestion but didnt work. It has no effect at all. It again displays "Press any key to continue ..."

@a3625799132 Same, No effect

@christiansorge [Error] '_getch' was not declared in this scope

I have decided to quit Dev C++ and work on Code Blocks instead. I think that would solve the issue.

Thanks for your support guys!
Topic archived. No new replies allowed.