Programming Abstraction in C++ # 01. Overview of C++

C++
1.Overview of C++

1.Overview of C++

1.2 The history of C++

📌Days before C++

People are using machine language which reflects the design of the hardware rather than the needs of programmers.

 

📌High-level programming language

The first high-level programming language is called FORTRAN(formula translation) which resembles the mathematical formulas into machine language.

 

📌Object-oriented paradigm

Before it, it is procedural paradigm represented by C. C++ is built of C and shifts the paradigm.

 

1.3. The compilation process

You should be aware of the following concepts:

  • source file
  • compiler
  • object file
  • executable file
  • libraries
  • linker

 

 

 

 

1.4. The structure of a C++ program

 

 

1.6. Data Types

📌Integer types

If long int + int, the result is int which will promote the precision.

 

📌Floating-point types

Floating-point with scientific notation.

E+8 means 108

 

📌Characters

ASCII stands for American Standard Code for Information Interchange.

 

The row stands for 10, col stands for 1. Therefore A is 65 = 10 * 6 + 5 * 1

 

📌Strings

The string is not a primitive type in C++ while it is, in fact, a library type(history artifact with C). In this book, we uses the string library wherever possible.

 

1.7. Expressions

📌Mixing types in an expression

The type-conversion is with the following order:

 

For example:

 

📌Truncation

It is the operation of discarding a decimal fraction.

 

📌Type casts

type cast in C++:

type cast in C#:

 

📌Embedded Assignment

While we don't recommend these kinds of operation which are difficult to understand.

 

📌Multiple Assignment

 

📌Increment and Decrement Operator

The difference between ++x and x++.

is equivalent to the following:

 

1.8. Statements

📌Predicate Functions

Functions like isVowel() or isAlphabet are called predicate functions.

 

Previous
Previous

Programming Abstraction in C++ # 02. Functions and Libraries

Next
Next

Essential C++ # 05. Object-Oriented Programming