Fundamental Differences Between C and C++

Some of the new language features that C++ provides over C have nothing directly to do with OOP. The following sections preview some of the non-OOP language differences that you'll find between C and C++.

Comments

One of the differences is the way that C++ allows you to place comments in your C++ programs. (A comment in C or C++ is the same as a remark in Visual Basic.) Any text that follows a double slash, //, is considered by C++ to be a comment. Therefore, you don't need a closing comment symbol, such as */, as you need in C. The following shows the same comment in C++ and then in C:

intCust++;  // Add to customer count

intCust++;  /* Add to customer count */

The C++ format is often simpler to code ...

Get Absolute Beginner's Guide to Programming, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.