5.1. Discussion of C++ and These Notes

C++ is a programming language that is an extension of an earlier language, C. For the most part, we will use the C subset of C++ in this course because it provides the tools that we need to explore physical data structures. A few of the language features that we will use are part of C++ but not of C. These notes make no attempt to offer a complete introduction to C++.

Java was designed to share many of its basic features with C++. The original intent was to make Java easy for C++ programmers to learn. But it also works the other way. If you already know Java, you will see familiar things in C++.

Important rule: C++ has a rigid form. Use only features that you have learned. Do not try to make up the language as you go and hope that it is right. That will take you into the swamp.


Free form

C++ is a free-form language. That means that

  1. in most places, an end-of-line is treated like a blank;
  2. in most places, any sequence of blanks, tabs or end-of-line characters is treated the same as a single blank.
Normally, you indent your program to make it readable. See the coding standards for how to indent for this course.

Places where the free-form rule is not in effect include

  1. comments that begin with // and end at the end of the line;
  2. string constants, such as "Blanks  matter  here".