c++
c++
Basics of Programming
● Program – a collection of text that commands a computer to perform algorithms.
● Programming Language – A collection of rules and syntax used to describe a program.
It is employed based on the user’s objective and the computer’s format and usage.
● Programming – The act of writing algorithms while utilizing a programming language.
● Statements that begin with the symbol #, processed by the preprocessor program.
Step 3: COMPILER
Step 4: LINKER
● Combines the object program with other programs in the library to create executable
code.
Step 5: LOADER
Step 6: EXECUTION
C++ Tokens
● Token – The smallest individual unit of a program written in any language.
Types of Tokens:
C++ Statements
● Declaration Statements – Used to declare things like variables.
● Executable Statements – Perform calculations, manipulate data, create output, and
accept input.
C++ Operators
● Arithmetic Operators – +, -, *, /, %
● Relational Operators – ==, !=, <, >, <=, >=
● Logical Operators – &&, ||, !
● Assignment Operators – =, +=, -=, *=, /=, %=
● Increment & Decrement Operators
○ Pre-increment: ++x
○ Post-increment: x++
○ Pre-decrement: --x
○ Post-decrement: x--
Expressions & Type Casting
● Expressions:
○ Integral Expression – All operands are integers.
○ Floating-Point Expression – All operands are floating-point.
○ Mixed Expression – A mix of operand types.
● Casting:
○ Implicit Type Coercion – Automatic type conversion.
○ Explicit Type Casting – Using static_cast<dataTypeName>(expression).
References