Jump to content
  • Advertisement
Sign in to follow this  
EmptyMinion

a little newb problem

This topic is 4842 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

#include <iostream.h> int main (void) { cout <<"Hello World\n"; } -------------------------------------------------------------------------------- ¿It doesnt do anything? What is wrong with it? (using Dev C++)

Share this post


Link to post
Share on other sites
Advertisement
Probably it does do something but closes the program before the output is seen.
Try calling this before the end of the function:

system("pause");

The command prompt will pause until a key is pressed.

Share this post


Link to post
Share on other sites
i get this error popping up with the system pause..Do i need to #include something else?
implicit declaration of function `int system(...)'

Share this post


Link to post
Share on other sites
The "system" function is a standard C function and is declared in stdlib.h, so if your compiler doesn't check it by default it's a good idea to include stdlib.h, forgot to mention [grin]

#include <iostream.h>
#include <stdlib.h>
int main (void)
{
cout <<"Hello World\n";
system("pause");
}

Share this post


Link to post
Share on other sites
#include <iostream.h>
#include <stdlib.h>
using namespace std;
int main (void)
{
cout <<"Hello World\n";
system("pause");
}
--------------------------------------------------------------------------------
still all it says is press any key to continue...
--------------------------------------------------------------------------------
<off the topic question> why does every one want to make a mmorpg?

Share this post


Link to post
Share on other sites
Is that the only code that's there? That kinda should give a compilation error you see.. You should have to use 'std::cout' or 'using namespace std' afaik..

If you link with some things, the output might be redirected to a local file, for example stdout.txt..

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!