Terminology and Symbols

◀ What This Book Covers▶ Naming Conventions
Amazon First I want you to be familiar with the terminology and symbols I will be using throughout the book. There could exist more than one term that refer to the same thing, and I do my best in using the most common and accepted terms.

The following table lists terms, their meanings, and examples. In the example column, sometimes I use ~ to replace the corresponding term for brevity.
TermMeaningExample
charA variable of type charThe function returns a char.
character arrayThe traditional C string, which is type char[]This function returns a character array.
char arraySame as aboveThis function returns a char array.
boolA variable of type boolThe function returns a bool.
bool arrayAn array of type boolThe function returns a bool array.
intA variable of type intThe first argument to getGPA() is an int.
int arrayAn array of type intThe function returns an int array.
doubleA variable of type doubleThe function returns a double.
double arrayAn array of type doubleThe function returns a double array.
stringAn instance of C++ string classThe function returns a string.
the invoking objectThe object that invokes the function
Student mike;mike.getID();mike is ~.
structA user-defined structureThe name of the struct is foo.
objectAn instance of a classJennifer is an object of class Students.
The following table lists symbols, their meanings, and examples.

SymbolMeaningExample
()A functionLets write a function swap() that swaps two elements in an array.
‘’A characterYou need to append a # to the end of the string.
“”A string or a wordinner#beauty#counts# is a valid input. The word template means…
<>A library headerYou need in this program.
The following table lists words in different fonts, each of which has a special meaning.

Sample WordMeaning
./computer_sum 20 100The sum of 20 and 100 is 120.
I use this font to indicate program outputs, user inputs, and actual program code.
data.txtdouble my_weightget_score()class StudentsI put in bold type file names, data types, variable names, instance names, function names, class names, and any other program elements.
Naming convention is critical!I use italic type to indicate emphasis, a special term, and chapter jokes.
Chapter 14Code SizeFigure 15.1I underline a chapter name, a section name, and a figure.
Very often I use the term “object” to mean “object reference”. In the following declarations:
Paint circle;
Paint square;
where Paint is a class, I refer to circle and square as objects of Paint to avoid wordiness. Technically, they are known as object references or instances. Just keep it in mind.

Also, when I explain something, I usually struggle over the way I call the subject person. If I call the person “he”, girls may feel a little discriminated against, but if I call the person “she”, guys won’t be happy. Anyway, I got to choose one, and I choose “he” because it is shorter. Please excuse me for any inconvenience this may cause.


In fact, if you are a girl and are really bothered by it, let me know and if enough people have brought up this request, I promise I will revamp this book and publish the updated version as soon as possible. You have my word.
◀ What This Book Covers▶ Naming Conventions

fShare
Questions? Let me know!