Dev C++ Help

Started by
26 comments, last by owiley 19 years, 5 months ago
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.
Computers are worlds of Exploration?
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")?
____________________________"This just in, 9 out of 10 americans agree that 1 out of 10 americans will disagree with the other 9"- Colin Mochrie
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)
Feel free to email me at NYYanks432@hotmail.com if you have any questions
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;}
-----------------------------------Panic and anxiety Disorder HQ
Ok for example; The code Hothead used above is perfect to illustrate in terms of how can I veiw the Hello World text. I am using Dev C++ as my compiler. Thanks for the replies!!!
Computers are worlds of Exploration?
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.
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?
Computers are worlds of Exploration?
Do you have using namespace std; in there? If not, I'm suprised that even compiles...

Do you get any compilation errors/warnings? Anything?
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.
Computers are worlds of Exploration?
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.

This topic is closed to new replies.

Advertisement