Jump to content
  • Advertisement
Sign in to follow this  
C_Programmer0101

Dev C++ Help

This topic is 4969 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

Advertisement
whoa there back up what compiler are you using and your question is kinda vauge there what do you mean gose to the press any button mode? system("pause")?

Share this post


Link to post
Share on other sites
Could you post what code you have at the moment?

Thanks (use the source tags too-- [ ] with the word source in between to start and [/ ] with the word source in between to finish)

Share this post


Link to post
Share on other sites
Quote:
Original post by C_Programmer0101
When I put in code in C++ it goes to the press any key mode. How can I make it so I can see hello world or even interact with other users.

here
#include <iostream>
#include <cstdlib>

using namespace std;

int main()
{
cout <<"hello world";
system("pause");
return 0;
}

Share this post


Link to post
Share on other sites
Press F9 to Compile and Run the program, select "Compile and Run" from the Execute menu or press the icon that looks like four coloured squares smooshed together.

Share this post


Link to post
Share on other sites
Ok maybee I am still not clear. After I compiled and ran my program it does not show the hello world at all. It just shows press any key to continue.

#include <iostream>

int main()
{
cout <<"hello world";
system("pause");
return 0;
}

What do I need to do to see the hello world portion?

Share this post


Link to post
Share on other sites
Do you have using namespace std; in there? If not, I'm suprised that even compiles...

Do you get any compilation errors/warnings? Anything?

Share this post


Link to post
Share on other sites
No I have not used namespace std; and yes I do get compiler errors and this is what is confusing me as a newbee. In Python if there is any errors it will not compile but in Dev C++ it will. What would a correct code look using a simple If statement for How old are you so I can see what all I have been missguided on. I have been using online tutorials.

Share this post


Link to post
Share on other sites
Ah, I think I see the problem.

You will have to look at the errors that are returned by the compiler and fix them. In your case, you will have to declare using namespace std; before your main routine, or use std::cout << "hello world!"; instead.

If you're unsure, post your errors up here as it'll help with a diagnosis of the problem.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!