🧭 Topic: Basics of C++ & Data Types
Quick Overview
This topic introduces how to compile and run C++ code, basic input/output, variables, built-in data types, and the math library.
By the end, students will be able to write simple C++ programs using variables and standard input/output streams.
📌 Covered in This Topic
Part 1 - Basics of C++
- History and Evolution of Computing
- Origin of the term computer
- Early computing devices
- Milestones in computer development
- Binary and Logic Fundamentals
- Why computers use binary
- Boolean logic and logic gates (AND, OR, NOT, XOR)
- Truth tables and simple logic circuits
- 32-bit vs 64-bit systems
- Data representation:
- Number systems (binary, decimal, hexadecimal)
- Signed numbers in binary
- Floating-point representation
- Character encoding: ASCII and Unicode
- Introduction to Programming Languages
- From machine code to assembly
- Evolution of high-level languages
- C++ in context: use cases and characteristics
- Low-level vs high-level abstraction
- Compilers and Program Execution
- How code becomes machine-executable
- Compiler vs interpreter
- Compilation workflow in C++
- First Steps in C++ Programming
- Writing and compiling a simple C++ program
- Basic input and output (
cin,cout) - Adding comments and documentation
Part 2 - Data Types and Variables
- Understanding Data in Programming
- What is data and how it’s represented in memory
- Relationship between data and variables
- Variables and Memory Basics
- Declaring and initializing variables
- Variable scope and lifetime (brief intro)
- Fundamental Data Types in C++
- Overview of primitive types (
int,float,double,char,bool) - Memory sizes and limits of each data type
- Signed vs unsigned integers
- Overview of primitive types (
- Integers
- Integer arithmetic and overflow behavior
- Type modifiers (
short,long,unsigned)
- Floating-Point Numbers
- Representation and precision limits
- Common rounding and comparison pitfalls
- Differences between
float,double, andlong double
- Characters and Text
- Character literals and ASCII table
- Escape sequences and their meaning
- Brief Introduction to Unicode and text encoding
- Working with
std::string
- Booleans and Logic
- Boolean literals and expressions
- Type conversions to and from boolean
- Constants and Immutability
- Declaring constants using
const - Benefits of using constants in programs
- Declaring constants using
- Type Conversion and Casting
- Implicit vs explicit type conversion
static_cast, and C-style casts (intro level)
- Assignment and Operators
- Simple and compound assignment
- Operator precedence overview (intro level)
- Naming Conventions and Code Style
- Common naming conventions in C++
- Writing clean and readable variable names
- Math Library Overview
- Using
<cmath>for basic mathematical operations - Common functions (
sqrt,pow,abs,round, etc.)
- Using
📑 Slides & Materials
🛠️ Workshop & Assignments
🌐 Additional Resources
⏩ Navigation
Tip
If something doesn’t make sense — don’t stay stuck alone. Ask the TA to clarify it right away. Often, a quick question can save you a lot of time and frustration. Remember: if you’re confused, chances are others are too.