Difference between C and C++

CombinationZero

Posts: 30   +0
I was not sure where to put this so forgive me if it belongs elsewhere.

I would really like to know because I wouldn't mind learning one. If you could recommend one to learn that would be great too. I hear its similar to Java which I learned a tiny bit of last year.
 
I was not sure where to put this so forgive me if it belongs elsewhere.

I would really like to know because I wouldn't mind learning one. If you could recommend one to learn that would be great too. I hear its similar to Java which I learned a tiny bit of last year.

First of all, the (rather silly) operator joke goes that C++ is called "C++" and not "++C" because it runs slower, yet returns the same functionality...

On the surface, Java and C++ might look the same, but Java is much simpler, for three (main) reasons:
1) Java comes with extensive libraries which do almost anything you can wish for - And these are standard. C++ on the other hand has very little as far as standardization goes.
2) Java is platform independent, C++ is not.
3) Much is hidden from the programmer, such as memory management.

This is not to say Java is better than C++, or vice versa (anyone arguing either point is acting silly - both have their places).

C is the basis of C++, and serves as a good starting point to study the latter. Unlike Java, C is not an Object Oriented language, so writing in it is different and not tied to the class/object concept. I would recommend at least getting slightly acquainted with C before trying to learn C++, although it is not an absolute must and the two differ in their standard libraries, Input/Output concepts, memory allocation/deallocation and other things.
 
FYI, another consideration is what you plan to use the code for. For example, it is very, very rare for an embedded systems programmer to use Java in an application due to higher overhead issues. They tend to use C or C++ to keep memory requirements as low as possible. Some times they still use BASIC for this reason. By the way, by "embedded systems" I am referring to code that doesn't run on a traditional computer, but is used in other electronic devices (e.g., automobiles, refrigerators, etc.)
 
FYI, another consideration is what you plan to use the code for. For example, it is very, very rare for an embedded systems programmer to use Java in an application due to higher overhead issues. They tend to use C or C++ to keep memory requirements as low as possible. Some times they still use BASIC for this reason. By the way, by "embedded systems" I am referring to code that doesn't run on a traditional computer, but is used in other electronic devices (e.g., automobiles, refrigerators, etc.)

I haven't heard of using basic for embedded applications, but Assembly coding is commonplace in the embedded world (like the coding I do at work, for example). Another reason why Java won't be used in many embedded systems is the fact that there is no JVM for most of the microcontroller architectures out there.
 
Oops...I meant Assembly...wrote BASIC...sorry...good catch direwolf...

About the JVM: I used to sell RTOes and TCP/IP stacks for 8-bit, 16-bit, and 32-bit processors. We looked into offering a JVM, but the overhead was too much for all but the largest 32-bitters.
 
I'm About to Make Mark Twain Proud........By Erasing All Doubt.....

I don't need to go into the whole quote, do I?

I thought that assembly code was processor specific. (!) or (?) (multiple choice) I distinctly remember not being able to program an Atari 1200 with it.

What does Python do? I always hear that name kicked around somewhere near Firefox.
 
Back