Helpful Information
 
 
Category: Computer Programming
C++ Compiler

I'm looking to start playing around with C++, but i know absolutely nothing about the language. What would you guys suggest as a good compiler for a complete beginner? ( freeware is a must; i have no money )

gcc of course. :)

If you don't have *nix or MacOSX, go grab Cygwin and run gcc on top of that.

If you want to do GUI stuff, Visual Studio is really the only way to go for Windows.

...

i don't know anything about C++, and even less about Unix. this particular route, although assuredly interesting, is probably not the best for me, just right at the moment.

a couple of note:

Borland comand line compiler:
http://www.borland.com/products/downloads/download_cbuilder.htmlhttp://www.borland.com/products/downloads/download_cbuilder.html

dev c++ (is an ide as well)
http://www.bloodshed.net/download.html

thanks, i went with borland.

i bought C++ for dummies (a very fine book) and tried compiling the same code that worked with GCC(which comes with the book) and borland free compiler. and the borland free compiler didnt work. any reasons?

Some compilers require:

void main() {
//blabla
}

Others require:

int main() {
//blabla
return 0;
}

Maybe that's it?

Well, I use MS VC++ compiler ... Good stuff ... but costs serious samoolies ;)

I know boring ol' C++. But I have this problem. I have Microsoft's Visual C++ and I cannot figure it out. It's too complicated. I have no understanding of Windows programming. This certainly isn't Visual Basic. Can someone point me to some kind of tutorial or something?

Originally posted by jkd
Some compilers require:

void main() {
//blabla
}

You should never use void main.
the main function is defined in the ISO C standard and requires a return value. It is bad code and will result in undefind behavior. It is possible that compilers allow it and some won't even give a warning (like VC++). But that doesn't mean it is correct.
void main is the devil ;) . Allways use:

int main()
{
return 0;
}

Originally posted by Fletcher
I know boring ol' C++. But I have this problem. I have Microsoft's Visual C++ and I cannot figure it out. It's too complicated. I have no understanding of Windows programming. This certainly isn't Visual Basic. Can someone point me to some kind of tutorial or something?

this should get you started (no offence if you know this stuff allready. If that is the case, I missunderstood you and I will die of shame :D

[list=1]
Go to File->New
Choose Win32 Console apllication for console programming (like DOS) or Win32 application for a windows program. This will create the Workspace (let's take the console application)
Give it a project name
choose an empty project -> Finish
again File->new (but the Tab will now point to FIles)
choose "C++ source file" and give it a name
you'll now have an empty text area where you can enter your code
[/list=1]
Enter the following Code: I know, you know this but there is still one catch to VC++ (in the console mode)


#include <stdio.h>

int main()
{
printf("This is my first VC++ application");

return 0;
}
and press F5. Now your program will compile.
The console box will imediatly close. there are two solutions to this: ask the users for input or use system("PAUSE"); (never used this myself)
a second solution is to press CTRL-F5 this will execute the program and you will automaticly promped to press a key before the console box shutts down

Well... I meant I don't know how to start unraveling the GUI aspect, the MFC.

doh,
::dies in shame :o ::

I don't know MFC (yet) but I would start with useing the Api Functions.
I can recomend you a good book: Programming Windows by Charles Petzold. I paid it about 70$ but it was worth it
Also these are some good sites:

Sunlight (http://sunlightd.virtualave.net/Windows/) Haven't used his windos tutorial, but his DirectX tut was pretty good
Ken Fitlike (http://www.foosyerdoos.fsnet.co.uk/): Not realy a tutorial, but he explanes very well the use of controls like listboxes, progress bars, tree view etc. (he doesn't use MSVC++ so there are some small differences










privacy (GDPR)