Skip to main content

CPP




Basics

  • Downloading and installing CodeBlock
  • Creating and explaining first project Hello World – the terms (keyword, main, header file)
  • Keyword – Keywords are reserved words for compiler whose purpose is already defined in compiler and user cannot use for personal use. E.g if, else, double, switch
  • main – main is a necessary function to define to execute C/C++ program. Without main, we cannot run our program.
  • Header file  - header file contains functions that perform certain tasks 
  • Characters \n, \t, \a
  • data types: int – 4b, float – 4b, double – 8b, char – 1b, string – equal to the number of characters
  • variable: rules to define a variable
    • cannot start with numbers and special characters.
    • Only special character acceptable is _ e.g. _age
    • Camel case: weightInKg
    • Snake Case: weight_in_kg
  • declaration vs initialization
  • arithmetic operations (+, -, *, /, %)

  • input from user – cin, getline()
  • relational operators (>=, <=, >, <, ==, !=)
  • if selection statement
  • if…else – double selection statement
  • block of statements
  • conditional operator (:?)
  • nested if

  • What is loop?
  • While loop
  • assignment operators (+=, -=, *=, /=, %=)
  • increment and decrement operators (post, pre)
  • for repetition
  • do while repetition statement
  • switch multiple-selection statement
  • logical operators – ( &&, || )
  • nested loop

Intermediate
  • What is a function?
  • Built-in functions – math library
  • Function definition vs function call
  • Function definition without parameter – void
  • Function definition with parameter – void
  • Function definition with return type
  • Function signature
  • Random number generator
  • Enum
  • Function with a reference parameter
  • Default arguments
  • Unary scope resolution operator
  • Function overloading
  • Function template
  • Recursion – Fibonacci example
  • Recursion – Factorial example

  • What is an array? (array index/subscript, first index)
  • Declaring array
  • Initializing array
  • Summing the elements of an array
  • Using bar chart to display array data graphically
  • Passing arrays to functions
  • Searching array with linear search
  • Sorting array with insertion sort
  • Multidimensional array
  • Template vector

  • What is the Pointer variable?
  • Pointer variable declaration
  • Pointer variable initialization
  • Pointer operators
  • Pass by reference with pointer
  • Selection sort using pass by reference
  • sizeOf Operator
  • pointer expressions with pointer arithmetic
  • Relationship between pointers and arrays
  • Arrays of pointer
  • Function pointers

Advanced
  • Concept of class
  • Concept of object
  • Public, private
  • Accessor and mutator aka getter and setter
  • What is Constructor
  • Constructor with default arguments
  • Destructor
  • Const objects and const member functions
  • Composition: Objects as members of classes
  • Friend functions and friend classes
  • Using this pointer
  • Static class member
  • Concept of Inheritance
  • Base classes and derived classes
  • Protected members
  • Constructors and destructors in derived classes
  • Public, protected, and private inheritance
  • Concept of polymorphism
  • Virtual functions
  • Dynamic binding or late binding
  • Abstract classes and pure virtual functions
  • Virtual destructor
  • Exception handling
  • Try and catch block
  • Keyword throw
  • Stack unwinding

  • Files and streams
  • Creating a sequential file
  • Reading data from file
  • Updating sequential file
  • Random-access file
  • Creating a random-access file
  • Writing data randomly to a random-access file

  • What is a class string?
  • String assignment and concatenation
  • Comparing strings
  • Substrings
  • Swapping strings
  • String characteristics
  • Replacing characters in a string
  • Inserting characters into a string
  • Iterators
  • String stream processing

  • Searching algorithms
  • Efficiency of linear search
  • Binary search
  • Efficiency of Binary Search
  • Sorting Algorithm
  • Efficiency of selection sort
  • Efficiency of insert sort
  • Merge sort
  • Efficiency of merge sort

  • Introduction to Standard Template Library (STL)
  • Introduction to containers
  • Introduction to iterators
  • Introduction to algorithm
  • Sequence containers
  • Associative containers
  • Container adapters
  • Algorithms 

Comments

Popular posts from this blog

3.Operating System - Services

Program Execution: The OS is responsible for executing programs. It loads the program into memory and executes the program. Program execution also includes process sync, process communication, and deadlock handling.  I/O Operation :  An I/O subsystem comprises I/O devices and their corresponding driver software. I/O operation means read or write operation with any file or any specific I/O device. OS provides the access to the required I/O device when required. File System Manipulation:  A file represents a collection of related information. A file system is normally organized into directories for easy navigation and usage. The operating system gives the permission to the program for operation on file. Permission varies from read-only, read-write, denied, and so on. Operating System provides an interface for the user to create/delete files. Operating System provides an interface for the user to create/delete directories. Operating System...

OS Outline

Operating System - Overview OS Definition Memory Management  Processor Management  Device Management  File Management  Security  Error Detecting Aids  Job Accounting Operating System - Types  Batch Operating System Time-sharing Operating System Distributed Operating System Network Operating System Real-time Operating System Hard real-time Operating System Soft real-time Operating System Operating System - Services Program Execution  I/O Operations  File System Management  Communication  Error-handling  Resource Management  Protection  Operating System - Properties  Batch-processing Multi-tasking Multi-programming Interactivity  Real-time system Distributed Environment  Spooling  Operating System - Process Process Program Process Control Block (PCB) Operating System - Process Scheduling Definition Process Scheduling Queues Job Queue Ready Queue Device Queue Two-State Process Model  Running...