I am starting to get back into C++ Programming. I am a beginner. Can someone let me know what type of compiler is the best. Is it worth it to buy one or are the free ones good enough. Please list your favorite compiler too.
Compiler Question
Collapse
X
-
Get a free one. The free compilers are good enough that you don't need to pay anymore. If you're using Windows, grab Dev-C++ or Cygwin if you want some Unix in your Windows. MinGW is also a thought. I use Linux, so gcc comes standard and thus I don't really have a 'favorite' compiler/IDE. Actually...Visu al Studio is free now, isn't it? That's not a horrible choice (recommending nearly anything Microsoft makes sticks in my craw). -
As far as windows is concerned I wouldn't recommend MinGW's gcc as I've had some strange problems problems with it (which I didn't have using gcc on linux or mac). Get a compiler specifically made for windows, like the one that comes with VC++ express (it's free).Comment
-
Originally posted by LaharlGet a free one. The free compilers are good enough that you don't need to pay anymore. If you're using Windows, grab Dev-C++ or Cygwin if you want some Unix in your Windows. MinGW is also a thought. I use Linux, so gcc comes standard and thus I don't really have a 'favorite' compiler/IDE. Actually...Visu al Studio is free now, isn't it? That's not a horrible choice (recommending nearly anything Microsoft makes sticks in my craw).Comment
-
Nothing is wrong. Your program is doing exactly what it is supposed, and so is Windows. You don’t have a console window open, so when you run a console program (the kind you just created), Windows opens up a console for you, runs the program there, and then closes the console when the program is done.
The correct way:
Learn to use the Windows console to run programs. There is a powertoy called “Open Command Window Here” or something along those lines. Comes in pretty handy, I think.
Might be possible:
I know this is true in Visual Studio, but I don’t recall for Dev-C++. There may be a way to run the program from Dev-C++, and have the IDE force the window to stay open. Look at the different ways you can run it. “Debug” is also one way to run the program, and may force the window to stay open.
The bad way:
Put a hack in your program. Look on Google for all the different hacks people have come up with to avoid doing it the correct way.Comment
-
Originally posted by arnaudkAs far as windows is concerned I wouldn't recommend MinGW's gcc as I've had some strange problems problems with it (which I didn't have using gcc on linux or mac). Get a compiler specifically made for windows, like the one that comes with VC++ express (it's free).Comment
-
Originally posted by oler1sNothing is wrong. Your program is doing exactly what it is supposed, and so is Windows. You don’t have a console window open, so when you run a console program (the kind you just created), Windows opens up a console for you, runs the program there, and then closes the console when the program is done.
The correct way:
Learn to use the Windows console to run programs. There is a powertoy called “Open Command Window Here” or something along those lines. Comes in pretty handy, I think.
Might be possible:
I know this is true in Visual Studio, but I don’t recall for Dev-C++. There may be a way to run the program from Dev-C++, and have the IDE force the window to stay open. Look at the different ways you can run it. “Debug” is also one way to run the program, and may force the window to stay open.
The bad way:
Put a hack in your program. Look on Google for all the different hacks people have come up with to avoid doing it the correct way.Comment
-
Ok so the Console is the C Prompt, do I just program in there. Is there a frustration smilie. I am trying to do a quick program fast while my toddler is busy and this is a huge setback. (Ok breathe..)
I saw a small example of how to do it on Yahoo answers. It is looking familiar like what I used in school.
I think I find a way I will try it out in a while as toddler now wants attention.
Ok.. back to the drawing board. I tried the debug thing and the cin.get(); and it still flashes off. Now off to learn the Window Console.Comment
-
If you want the console window to stay open then add a line of code that says system("Pause") ;
Should hold it open for you, I believe this only works in windows, just in case you were to try it on another os, I could be wrong though.Comment
-
Adding system("pause") as the last line before "return 0" in main() has been my standard solution when faced with this problem.
Ideally, you would compile your program using Dev, but then get to your program using DOS and run it that way. Then the program would run, the output would be generated, and control would return to you - without ever closing the window.Comment
-
Originally posted by curls8Thanks, I just downloading Dev-C++. I just tried to make a simple Hello World, it compile find, but when I tell it to Run a small black screen just flashes and that is it, I am not seeing my program excute. Do you happen to know what is wrong?Comment
Comment