Best C++ compiler and tutorial/book?
Asked by
skorned (
97
)
July 18th, 2009
I have had some experience with programming in the past with VB 2008 in Visual Studio. However, I’d like to learn a more powerful language, and due to some circumstances, have decided to work on C++.
I have Windows, Mac and Unix machines, so can someone suggest the best compiler for it? I just started with Hello World in Turbo C++ using the free online book ‘How to Think Like a Computer Scientist’.
However, there are 2 major problems. One, in another book I read, I realised that the syntax Turbo is using is old, not the new ANSI- C standard. I’m assuming corporates and the real world have adapted the new standards, so it would be best for me to adopt an ANSI-C compiler. I tried Visual C++ but found it very wierd, as if they had a completely different syntax altogether, with t_main instead of main and stuff. Examples I lifted directly from books refused to work in Visual Studio. Should they be working, or does Visual C++ use slightly different syntax? Anyhow, I’ve tried my hand with Visual C++, Turbo, and GCC in backtrack, but didn’t like any. Can someone point me to the best standards compliant widely used compiler/IDE?
And also a book or tutorial that has examples that would work in that compiler please?
And if this thread is a duplicate, I’m sorry, I searched but surprisingly couldn’t find anything like it. If I didn’t look hard enough, please help with a link to the thread?
Observing members:
0
Composing members:
0
4 Answers
Your best bet for a compiler is probably gcc, despite your experience with it. On Linux, you’ll need to worry about an editor or IDE as well, and on that I can’t really advise you, since I’ve been using Emacs for 20+ years; on the Mac, the best choice is Xcode, which uses gcc as the backend compiler.
Standards compliance is a difficult matter. C++ is a big and complicated language, and I wouldn’t be surprised at all if none of the major and popular compilers were fully standards compliant.
Microsoft has built a lot of infrastructure into Visual Studio, and a lot of the changes will make sense only after you have a solid grasp of C++ and a basic understanding of Win32 or .NET.
As far as books go, when I first learned C++ (in the days of cfront), the book C++: How to Program was one of the best.
@cwilbur , is there anything more of an IDE with a built-in compiler, and with some basic functions like auto-indenting and syntax highlighting…autosuggest functionality like MS’s Visual C++ would be a nice addon…in fact I tried VC++ again today, and surprisingly, it worked. I even got Turbo C++ to work today, although it wasn’t working yesterday…dunno what I was doing wrong.
anyhow,, thanks for all the help….for now, I’ve got things working in VC++. Don’t hate on MS now, I know I know…monopoly this unfair practice that…but still….you can’t beat the convenience of nice auto-formatting auto-suggesting, with easy one-click compile/running…
and @ratboy , thanks…i found that book through some other sources, and am loving it…its slightly extra lengthy for me because its written with absolute beginners to programming in mind and hences spends a lotta time explaining basic concepts like variables and stuff…but when I skim over it, its really nice, gotten me up and running in no time at all…
@skorned: there probably is, but as noted, I’ve used Emacs for 20 years, and don’t see any reason to change.
Answer this question 
This question is in the General Section. Responses must be helpful and on-topic.