• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

&!*% it I'm going to learn C++

Locut0s

Lifer
Ok so I know Java well enough to dabble a bit. Well enough to put together VERY simple programs. But I'm still what you would consider a really N00b programmer. I've been meaning to learn C++ for quite some time now but have never taken the plung. Fuck it I've decided I have to start today. I'll take it slow and go from there. I have a god book here "Deitel and Deitel's C++ how to program 3rd edition", a little old but it takes it from a fully OO perspective and covers a hell of a lot. So the only question I have it what compiler would you recommend I download? I'm running Windows 7.

Ultimately I plan on going back to university and possibly getting a CS degree, or other degree, but for now I want to keep this a serious hobby.
 
Last edited:
... I'm running Windows 7.

Ultimately I plan on going back to university and possibly getting a CS degree, or other degree, but for now I want to keep this a serious hobby.

These two observations may be a little at odds. In your explorations, try to avoid functionality that is very Microsoft-specific, lest you find yourself out on a limb if your chosen institution teaches on a *nix clone, as many do.
 
Visual C++ Express from MS is a free and rather powerful IDE (with a compiler obviously). This is a personal thing but I don't personally enjoy programming in C++ at all. Too many annoying "gotchas" in the language, I find myself spending more time debugging some silly bug that turns out to be a language quirk that I do solving real problems, but that's just me. I'd much rather program in C or C# if I'm programming for fun.
 
These two observations may be a little at odds. In your explorations, try to avoid functionality that is very Microsoft-specific, lest you find yourself out on a limb if your chosen institution teaches on a *nix clone, as many do.
You don't have to use MS language extensions just because you're running an MS OS
confused-icon.gif
It's very easy to flag the compiler to accept any given version of the language.
 
You don't have to use MS language extensions just because you're running an MS OS
confused-icon.gif
It's very easy to flag the compiler to accept any given version of the language.

Of course. I was advising the OP not to confuse any Windows-specific C++ features with vanilla C++. VS++'s environment is naturally very Windows-specific, and in the course of his learning with it, he will of course use a lot of those Windows-specific features.

EDIT: After reading my above reply, I have decided it is a little unclear.

First of all, my caution is intended to make OP aware that VS++ (and nearly all compilers, actually), allows certain behaviors that may not be allowed in other environments. For example, consider the Microsoft C and C++ extensions: http://msdn.microsoft.com/en-us/library/34h23df8%28VS.80).aspx

There is also the need to be aware that there are very substantial library differences between platforms. This is merely cautionary. I also 'learned' C++ on Windows, and I was very confused about what was cannon C++, and what was Windows-specific library functionality, or VS++-specific compilation.

The above should not be taken as an argument against VS++. Given OP's situation, VS++ is the best strategy to start. However, he should follow guides that are agnostic of the underlying infrastructure, to avoid confusion. Deitel and Deitel is a pretty good guide, in my estimation, based on skimming it.
 
Last edited:
I'd get the MS visual studio free edition and go from there.

Yes, it's windows specific, but the IDE is very good with excellent documentation (MSDN). There is alot of documentation out there on the web. Learning C++ can be quite confusing, so once you get the basics, I'd suggest moving on from there.
 
Visual Studio has a good and easy to use debugger for C++, which can help you figure out why your code is doing what you tell it to do instead of what you want it to do.

Single-stepping through your code and watching the variables change is a good learning experience.

The MSDN docs are good about marking what are MS-specific extensions vs. ANSI C/C++
 
C++ is a good language to learn, but try to not tie yourself to the VC++ as C++ is actually a multi platform language but if you learn only the MS way then mostly everything you learn wont work on other platforms. To start off VC++ is not a BAD idea, but just keep open that there's more to it then that. I would personally start with console apps, maybe client/server apps or a basic custom DBMS just for learning purposes.

Once you get into GUI then you will probably want to go with VC++ or whatever the Linux/mac equivalent is (depending what platform you want to mostly code for).

C++ is a very powerful language that can do quite a lot, so it's good to learn.

Also learn OOP, but I would not jump straight into that, give yourself time to learn the basics first. Since you did java OOP might not be that hard to pickup though.
 
Thanks for all the suggestions guys.

RedSquirrel: I already know OOP concepts relatively well. Inheritance, abstraction, polymorphisms, interfaces (which C++ doesn't really support) etc... I'm just not used to OOP from the C++ perspective.

When I was doing Java stuff I learned enough to program a full GUI tic tac toe game and a flat file database program for managing collections of books. These were all done using OOP. However that was some time ago and it's been a while since I did any programming.
 
Deitels books are among the best. My professors taught C++ from them, and when I taught C++ myself for 2 semesters, I taught from it.
 
How is using Visual Studio going to make you a Windows specific programmer? VS doesn't make any Windows specific extensions to the C++ language itself, does it? The only thing I can think of is depending on what you are doing it may steer you towards using propriety microsoft libraries instead of multiplatform ones. GUI programming is a big one. But it doesn't stop you from using different libraries if you choose to.
 
It sure does. http://msdn.microsoft.com/en-us/libr...8VS.80).aspx

In fact, many compilers make language extensions. For example, here are g++'s C++ extensions:
http://gcc.gnu.org/onlinedocs/gcc-4.4.3/gcc/C_002b_002b-Extensions.html#C_002b_002b-Extensions

Not going to be a problem for me probably as I'm going to be relying on the Deitel book for a while and then after that I'll be learning via tutorials, other programmers code and the like. I won't be using any compiler specific stuff as far as I know.
 
Not going to be a problem for me probably as I'm going to be relying on the Deitel book for a while and then after that I'll be learning via tutorials, other programmers code and the like. I won't be using any compiler specific stuff as far as I know.

Right-o. I overemphasized the 'compiler specific' argument in this thread. Bad judgment on my part there. I think you'll do very well following the Deitel & Deitel book.
 
good for you.

memory management is what makes c++ more challenging. use a memory leak program such as valgrind if in linux, or visual studio's in windows.
 
Right-o. I overemphasized the 'compiler specific' argument in this thread. Bad judgment on my part there. I think you'll do very well following the Deitel & Deitel book.

I have to buy the book for my college C++ class, so yea, its supposedly a great book.
 
The problem with things like Visual xxx based products is they have you doing a lot of things that have nothing to do with learning the language. You don't need to manage projects or worry about settings or quirks of an ide to learn a language. All of that is just time wasted when you could be learning the language itself rather than learning an ide.

I agree with above, get DEVC++. 10MB download and is very easy to use.
http://www.bloodshed.net/dev/devcpp.html
 
The problem with things like Visual xxx based products is they have you doing a lot of things that have nothing to do with learning the language. You don't need to manage projects or worry about settings or quirks of an ide to learn a language. All of that is just time wasted when you could be learning the language itself rather than learning an ide.

I agree with above, get DEVC++. 10MB download and is very easy to use.
http://www.bloodshed.net/dev/devcpp.html

Technically true, however a big component of learning how to program is interactivity, imo. You want to be able to code, run, see the output or error, fix or modify, repeat. That's the kind of immediate access and feedback we got from BASIC back in the day.

I wouldn't advise someone coming to C or C++ for the first time to download gcc. An IDE makes it all much more approachable, and you can always dive in and learn more about the under-the-hood stuff when you get the fundamentals down.
 
The problem with things like Visual xxx based products is they have you doing a lot of things that have nothing to do with learning the language. You don't need to manage projects or worry about settings or quirks of an ide to learn a language. All of that is just time wasted when you could be learning the language itself rather than learning an ide.

I agree with above, get DEVC++. 10MB download and is very easy to use.
http://www.bloodshed.net/dev/devcpp.html
Do NOT get Dev-C++. Under no circumstances should this ever be recommended as an IDE. For 3 major reasons

1. It is not being actively developed
2. It has lots of bugs that I've personally ran into, ranging from stability issues to "mess up your project" type bugs.. Very annoying.
3. It is using, by default, a very old version of gcc. With all the bugs and holes that come along with that.

Code::block and MS Visual studios are my recommendations. Both are free and lightyears ahead of Dev-C++. While CB hasn't had a recent major release in a while, the nightly builds are still going strong (IE development is still occuring). Other mentions are Netbeans and eclipse with the C++ plugin.

I don't know why Dev-C++ is still the popular "free" IDE to recommend, there are several actively developed solutions that do so much better then Dev-C++ does.
 
Last edited:
Back
Top