Dev C++ Help
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.
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")?
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)
Thanks (use the source tags too-- [ ] with the word source in between to start and [/ ] with the word source in between to finish)
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;}
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!!!
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?
#include <iostream>
int main()
{
cout <<"hello world";
system("pause");
return 0;
}
What do I need to do to see the hello world portion?
Do you have using namespace std; in there? If not, I'm suprised that even compiles...
Do you get any compilation errors/warnings? Anything?
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.
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.
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
Popular Topics
Advertisement