C++ help

<p>Dev-C++ 4 wont seem to work on my comp for some reason. Whenever i try to install it, a message comes up saying "The system file is not suitable for running MS-DOW and Microsoft windows Applications". So I tried installing Dev-C++ 5, but the code i put in it doesnt seem to work. For example, a hellow world program should be </p>

<h1>include <iostream></iostream></h1>

<p>int main()
{</p>

<pre><code> std::cout << "Hello World!
";
return 0;
</code></pre>

<p>}</p>

<p>right? But for some reason, the window only pops up for a split second and then closes whenever i try to run it. What am i doing wrong?</p>

<p>thats strange cuz that code is correct.</p>

<p>You are doing absolutely nothing wrong. The problem is that the program displays hello world and exits immediately. Put a pause or cin or something to pause it.</p>

<p>Yeah, there is nothing wrong with your code, it's just that Dev is a very different program to use. I used it at the beginnning of my CompSci class, and I always had to put some cin >> x; statement at the end so it wouldn't immediately exit. However, as the newer versions of the program became increasingly complex (even to do simple C++ stuff, eventually the newest update refused to compile anything) I tracked down a copy of Microsoft's Visual C++ and worked with that- much easier to use, especially sense that's what the class used. </p>

<p>Bottom line: Many people swear by Dev, but unless you're doing some heavy duty coding, the complexities far outweigh the benefits.</p>

<p>Get a real OS (Linux) with a real compiler (GCC)</p>

<p>This is how almost all compilers work for me. Put in an input command.</p>

<p>larry100, I very highly doubt that switching to linux will help him. Furthermore, I would like to know where you find sources suggesting that GCC is superior to MS VC++? In any case, Dev C++ uses GCC, so I don't know where you are getting that either. If hold the Microsoft Visual C++ 2003 Optimizing Compiler against the ISO C++ Standard, you will see it as 98% compliant, far more compliant than GCC.</p>

<p>OP: There should be an option not to immediatly close the window somewhere in the IDE.</p>