Introduction to C++

Module Overview
C++ supports both procedural and object-oriented programming (OOP), giving developers flexibility and efficiency. It allows direct memory management and low-level system access, making it suitable for performance-critical applications. C++ has a large standard library, supports templates, classes, and exception handling, and is known for producing fast and efficient programs.

LEARNING OUTCOMES

  • • Understand the Basics of C++
  • • Write Basic C++ Programs
  • • Control Program Flow
  • • Work with Functions
  • • Understand Object-Oriented Concepts
  • • Manipulate Data
  • • Debug and Test Code
  • • Develop Simple Applications
  • Unit 1: Understanding the Web and C++

    Unlike languages like JavaScript, C++ is not a web-based scripting language. Instead, it is a general-purpose, compiled programming language primarily used for software, games, and systems development. However, understanding how C++ interacts with web-related technologies can be useful in some contexts.

    KEY TERMS

  • • C++ – A high-performance programming language used for system/software development, games, and applications.
  • • Variable – A container that stores data values, e.g., int age = 18;.
  • • Data Types – Types of data in C++, including:
  • • Constant – A value that cannot be changed after being declared, e.g., const float PI = 3.14;.
  • • Operator – Symbols that perform operations on values, e.g., +, -, *, /, ==.
  • • Function –A block of code that performs a specific task and can be reused, e.g.,
  • • Class – A blueprint for creating objects, supporting object-oriented programming.
  • • Object – An instance of a class containing data (attributes) and functions (methods).
  • • Loop – Repeats a block of code multiple times: for, while, do-while.
  • • Conditional Statement – Makes decisions in code: if, else if, else, switch.
  • • Array – A collection of elements of the same data type stored in contiguous memory..
  • • Pointer – A variable that stores the memory address of another variable.
  • • Reference – An alias for another variable, allowing indirect access.
  • • Namespace – Groups related code and prevents name conflicts, e.g., using namespace std;.
  • • Header File – A file containing function declarations and macros, included using #include
    .
  • Unit 2: C++ Document Structure

    C++ program is usually saved with a .cpp file extension and follows a structured format to organize code efficiently. Understanding this structure helps write readable and maintainable programs.

    CORE STRUCTURE COMPONENTS

  • • DOCTYPE declaration
  • • html root element
  • • head section
  • • body section
  • Unit 3: Text and Content Elements

    HTML provides various elements for displaying text content. Headings create hierarchy, while paragraphs organize readable text blocks. Inline elements such as strong and emphasis help highlight important information within paragraphs.

    COMMON TEXT ELEMENTS

  • • Preprocessor Directives
  • • Namespace Declaration
  • • Main Function
  • • Variables and Constants
  • • Statements and Expressions
  • • Functions
  • • Comments
  • • Data Structures
  • hover any card → interactive glow, shift, and icons respond

    interactive ✦