Introduction to C++ Programing-程式設計筆記

Shih Jiun Lin Lv4

Chapter 2, Introduction to C++ Programing

The Sturcture of Basic C++ Program

  • The lines start with # are processed by the preprocessor.
  • <iostream> is the input/output stream header file.
  • The int main() means that the main program will return an integar value.
  • std::cout specifies that we are using namspace std.

The Use of Escape Sequence

The Declaration of Variables

  • void => Function does not return a value.

  • int => Declare integar variables.

  • char => Declare character variables.

    • char can also be stored as integer.
  • float => Declare floating-point variables.

  • double => Declare double-precision variables.

  • bool => To hold a boolean value, true/false. ## Arithmetic Operators

  • The rules of operator precedence as generally same as those in algebra.

  • Exponentiation -> Import <math.h>

Equality and Relational Operators

  • Title: Introduction to C++ Programing-程式設計筆記
  • Author: Shih Jiun Lin
  • Created at : 2023-01-17 23:00:50
  • Updated at : 2023-01-24 01:31:12
  • Link: https://shih-jiun-lin.github.io/2023/01/17/Chapter 2, Introduction to C++ Programing/
  • License: This work is licensed under CC BY-NC-SA 4.0.