ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
C++ beats C hands down for most large projects - except when it comes to performance issues. Obviously the mechanisms in C++ are bloated when compared to the raw efficiency of C.
However, comparing structs and classes just isn't right. And while you may be able to emulate some aspects of OOP in C, you can't do it all. I'll also agree (as it's been said here lots before) that there are other younger OOP languages that are much easier to get into.
I think C is more suited to programming, and C++ more suited to software engineering.
Originally posted by Harishankar You can write C programs in C++. Therefore there is no such thing as moving away from C.
C is C++' biggest enemy! This "feature" is what makes C++ unreliable when used by beginners.
Back to the subject. I've read somewhere, that there are difference of interpretation issues with some points of the C++ specification, that make the C++ language less portable than C, accross different hardware and software. Remember that Linux is NOT only for x86, and many programs often are not only for Linux, but also for *BSD, and even other Unixes.
Does it mean that different C++ compilers behave differently depending on what their authors think as "correct"? Then, what's the difference with C compilers, which differ from each other too? Or you are saying that differences in C++ compilers are more noticeable?
Couldn't you try to refresh your memory and post a link? It would be interesting to know these drawbacks of C++ compilers in detail.
That's what I mean.
Differences in C compilers mostly relate to optimisation.
Differences in C++ compilers may have to do with their support of some features, or with the meaning they give to given lines of source code.
Not to mention that fundamental changes happened which broke compatibility multiple times between 2.95 and 3.3.x versions of GCC when it comes to C++ code and the ABI. Hopefully things will be a bit more solid from now on so we won't have to port code from one version of GCC to another.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.