# 🧭 Topic: Basics of C++ & Data Types


> [!info] 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

1. **Understanding Data in Programming**
    - What is _data_ and how it’s represented in memory
    - Relationship between data and variables
2. **Variables and Memory Basics**
    - Declaring and initializing variables
    - Variable scope and lifetime (brief intro)
3. **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
4. **Integers**
    - Integer arithmetic and overflow behavior
    - Type modifiers (`short`, `long`, `unsigned`)
5. **Floating-Point Numbers**
    - Representation and precision limits
    - Common rounding and comparison pitfalls
    - Differences between `float`, `double`, and `long double`
6. **Characters and Text**
    - Character literals and ASCII table
    - Escape sequences and their meaning
    - Brief Introduction to Unicode and text encoding
    - Working with `std::string`
7. **Booleans and Logic**
    - Boolean literals and expressions
    - Type conversions to and from boolean
8. **Constants and Immutability**
    - Declaring constants using `const` 
    - Benefits of using constants in programs
9. **Type Conversion and Casting**
    - Implicit vs explicit type conversion
    - `static_cast`, and C-style casts (intro level)
10. **Assignment and Operators**
	- Simple and compound assignment
	- Operator precedence overview (intro level)
11. **Naming Conventions and Code Style**
	- Common naming conventions in C++
	- Writing clean and readable variable names
12. **Math Library Overview**
	- Using `<cmath>` for basic mathematical operations
	- Common functions (`sqrt`, `pow`, `abs`, `round`, etc.)

---
## 📑 Slides & Materials
- 👨‍🏫 [Professor Slides (PDF)](01-topics/02-basics-and-data-types/4-ProfessorSlides.md)
- 🧑‍🏫 [TA Workshop Slides (PDF)](01-topics/02-basics-and-data-types/5-TASlides.md)

---
## 🛠️ Workshop & Assignments
- 💬 [Workshop Questions](01-topics/02-basics-and-data-types/1-Workshop.md)
- 🧮 [Assignments](01-topics/02-basics-and-data-types/2-Assignment.md)  
- ❓ [Q&A and Common Issues]()

---
## 🌐 Additional Resources

- [C++ Reference](https://cplusplus.com/reference/)  
- [Learn C++](https://www.learncpp.com/)  
- [Data Types in C++ (W3Schools)](https://www.w3schools.com/cpp/cpp_data_types.asp)

---
## ⏩ Navigation

- ⬅️ [Previous Topic: Problem Solving](../01-problem-solving/0-Overview.md)  
- ➡️ [Next Topic: Conditions & Loops](../03-conditions-loops/0-Overview.md)

---

> [!tip] 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.







