Hi,
I'm not sure this is the exact problem, but the code you posted isn't the
correct way to use system("pause"):
It should be inside the 'main', like so
#include <iostream>
using namespace std;
int main()
{
cout<<"Hello World!\n";
system("pause");
}
why dev-cpp didn't warn you loudly, I don't know...
Also, if writing twice the same program doesn't seem to yield the same
results, I'd try to make sure the program is getting recompiled properly
(try deleting all the .exe, .o, and Makefile.win, also, try make clean
[Rebuild all in dev-ccp I think])
Jonathan
On 1 Apr 2007 17:15:28 -0000, Devashish Shanker <
dev...@re...> wrote:
>
> (pwm and Aamynuttal, please ignore this message)
> Hi!
> I've a very unique problem about execution of Cpp.
> I entered the code and the source was compiled without any errors. The
> windows application was created, but didn't open (or it opened for a split
> second and closed). I tried system("pause"); the result was that an
> application opened, saying "press any key to continue", but the expected
> output was not there. The simple code was:
> #include <iostream>
> using namespace std;
> int main()
> {
> cout<<"Hello World!\n";
> }
> system("pause") didn't print "Hello World". Then I tried:
> modifying cout<<"Hello World!\n";
> but that, too didn't work.
> When I tried
> cin.get();
> the application started running in the desired way.
> Then, I had deleted that application and source file.
> When I again wrote the same program with cin.get(); it didn't work!
> (didn't open!) I'm wondering what creates such a problem.
> Please Help!
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
--
<Morpheus> linux, c'est une question de VI ou de MORE
|