Highor Posted March 26, 2005 Share Posted March 26, 2005 Hello,when i do this:#include <iostream.h>int main(){cout << "Hello World!\n";return 0;}he will open the .exe and close it immediatly...how can i fix this?thanks Link to comment Share on other sites More sharing options...
gamehead200 Posted March 26, 2005 Share Posted March 26, 2005 #include <iostream.h>using namespace std;int main(){cout << "Hello World!\n";system("PAUSE"); // will ask user to press any key to exitreturn 0;} Link to comment Share on other sites More sharing options...
Highor Posted March 26, 2005 Author Share Posted March 26, 2005 Thanks.and the next question is, why is it in a DOS promt?in history i had a "windows window" with text in it.how can i fix this?( Example: http://www.highor.com/likethis.JPG ) Link to comment Share on other sites More sharing options...
gamehead200 Posted March 26, 2005 Share Posted March 26, 2005 Its in a DOS prompt (command prompt) because you haven't developed a GUI for it yet... Don't worry... This is how C++ starts out for everyone (mostly)... Even I'm still learning using this as well... Link to comment Share on other sites More sharing options...
Highor Posted March 26, 2005 Author Share Posted March 26, 2005 but it looks not like a program now but a bat file or something.how can i change the GUI?,and is there a tutorial or something how to add a textfield ? were you can write in ect..?and i want to know how i can change my title of the screenthnx Link to comment Share on other sites More sharing options...
purewaveform Posted March 30, 2005 Share Posted March 30, 2005 what is your goal, and you already posted this question in another thread, I answered the original question there. As for the gui, you cant directly, other than doing the system commands for a dos prompt. If you want to use a window then you need to create it in code, not someting you can do in three lines. You need to google it and there are lots of exmaples on how to create a window. Link to comment Share on other sites More sharing options...
Juice011 Posted May 9, 2005 Share Posted May 9, 2005 Hey all im interested in starting using C++ but i cant seem to find a good compiler to use anyone have a good one thats free? Link to comment Share on other sites More sharing options...
Zxian Posted May 9, 2005 Share Posted May 9, 2005 Dev-C++ is one of the best freeware programs out there. It comes with the g++ compiler built right in and handles multiple files very well (when you get to that stage). Link to comment Share on other sites More sharing options...
dman Posted May 9, 2005 Share Posted May 9, 2005 Free MS .NET SDK has compilerhttp://www.microsoft.com/downloads/details...&displaylang=en Link to comment Share on other sites More sharing options...
MHz Posted May 9, 2005 Share Posted May 9, 2005 Bloodshed software for a good free IDE. Link to comment Share on other sites More sharing options...
Zxian Posted May 10, 2005 Share Posted May 10, 2005 how can i change the GUI?,and is there a tutorial or something how to add a textfield ? were you can write in ect..?<{POST_SNAPBACK}>I think that for a pretty GUI, you need to learn about MFC (Microsoft Framework Controls) - I think that's what it's called. This isn't the same thing as .NET Framework, but it's the core of the Windows GUI that's available to programmers.I can tell you with great confidence right now that you should stick with the command line interface for the time being until you get a hold of all the finer details of programming (memory management, data structures, etc). Once you've got those things under control, porting your work over to a GUI is a piece of cake. Link to comment Share on other sites More sharing options...
Fork18 Posted May 16, 2005 Share Posted May 16, 2005 if you are a total 'newbie' in c++ then i don't think you will learn much of just asking in a forum.. start with reading a good book! 'thinking in c++' and 'teach your self c++ in 21 days' are some kick starting stuff so you will understand things fast.. well, atleast i did.. but i've programmed in vb for some years so i think that helped me alot for the move to c++.. Link to comment Share on other sites More sharing options...
spiritpyre Posted June 6, 2005 Share Posted June 6, 2005 I agree. Its a good idea not to rush yourself or bite off too much at once. When I started programming I just wanted to hurry up and make something cool I could run on windows. I've had two classes in C++ and one in assembly language (if you don't like c++ try a good old ASM course... its a real b**** lol). and I still get confused with all the different components of visual programming (partly because I get distracted easily partly because i haven't really been programming for about a year ) and well I'm still impatient.here's a way to keep the console from closing -- basically the best ways are add code that waits for a keypress, or open a command prompt and then call it from within the prompt.As for going visual, I tried Visual C++ 6 in 24 hours (although I was reading about an "hour" a day and i still haven't managed to finish the book... ) Note: that means i'm lazy and i get sidetracked easily and isn't meant to down the book, although for me it did kind of drag along at a slow pace Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now