Which C++

Hi Guys,

Pardon me for asking a rather silly question. I am not new to programming, having done the usual web-development stuff like PHP, JavaScript, MySQL etc for a number of years now. Also 100% of my coding is done on Debian GNU/Linux since 1996, so I am not entirely new to "other" languages either like Perl, python and Ruby (only beginner to mildly intermediate stuff though).

However I feel I need to go a different route in the near future. I love ncurses and would like to know where to begin bearing in mind that most of my (future) apps will be coded for ncurses.

What confuses me is the following: Which C++ should I learn? ANSI/ISO or some other "version"? The reason I ask is that in Linux you get a myriad of IDE's including Anjuta, KDevelop and Eclipse. I have played around a little bit with them (Hello World) stuff and none of them are the same. I cannot copy and paste the code from the one to the other cause they complain a lot about include files etc. (Please don't ask to explain, cause I don't know). So I gathered that none of them run the same "version" of C++. I don't want to learn one version and later find out that it is the "wrong" one.

Could you also recommend a (non-Microsoft Windows) book to aid me?

Thank You

Danny
You want to learn C++ according to the ISO/IEC 14882:2003 (C++03) standard.
Last edited on
Ideally, there's one and only one C++, which is ISO C++. In reality, every compiler implements a slightly different subset of the whole standard, but don't worry about that, for now.
All of those IDEs you mentioned use by default g++ (GCC's C++ compiler) under Linux, so any errors you're getting are due to an improper configuration of the project files on your part, not because they're using different compilers.

Since you're used to Linux, I'd suggest that you use the command line, for now, as it should be much simpler than using an IDE. Try compiling this:
1
2
3
4
5
6
7
//hello.cpp
#include <iostream>

int main(){
    std::cout <<"Hello, World!\n";
    return 0;
}
with g++ hello.cpp -o hello && hello

As for a book, most C++ books I've seen don't assume you're using any particular compiler, and the ones that do limit themselves to code that compiles and works the same on all platforms. Try The C++ Language or C++ Primer.
Thank you guys.
Topic archived. No new replies allowed.