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

7.Operating System - Memory Management

Process Address Space:   The process address space is the set of logical addresses that a process references in its code. Static vs Dynamic Loading:  The choice between Static or Dynamic Loading is to be made at the time of the computer program being developed. If you have to load your program statically, then at the time of compilation, the complete programs will be compiled and linked without leaving any external program or module dependency. If you are writing a dynamically loaded program, then your compiler will compile the program and for all the modules which you want to include dynamically, only references will be provided and the rest of the work will be done at the time of execution. At the time of loading, with static loading, the absolute program (and data) is loaded into memory in order for execution to start. If you are using dynamic loading, dynamic routines of the library are stored on a disk in re-locatable form and are loaded into memory only when they a...

8. Operating System - Virtual Memory and Input/Output

Definition: A computer can address more memory than the amount physically installed on the system. This extra memory is actually called virtual memory and it is a section of a hard disk that's set up to emulate the computer's RAM. The main visible advantage of this scheme is that programs can be larger than physical memory. Virtual memory serves two purposes. First, it allows us to extend the use of physical memory by using disk. Second, it allows us to have memory protection, because each virtual address is translated to a physical address. Demand Paging: A demand paging system is quite similar to a paging system with swapping where processes reside in secondary memory and pages are loaded only on demand, not in advance. Page Replacement Algorithm: Page replacement algorithms are the techniques using which an Operating System decides which memory pages to swap out, write to disk when a page of memory needs to be allocated Reference String: The string of memory references i...

9. Operating System - Extra

Interrupt:   In system programming, an interrupt is a signal to the processor emitted by hardware or software indicating an event that needs immediate attention. Trap:   In computing and operating systems, a trap, also known as an exception or a fault, is typically a type of synchronous interrupt caused by an exceptional condition (e.g., breakpoint, division by zero, invalid memory access). Signal:   A signal is a software-generated interrupt that is sent to a process by the OS because when the user press ctrl-c or another process tells something to this process. There is fix set of signals that can be sent to a process. Signals are identified by integers. A signal number has symbolic names. System call:   The interface between a process and an operating system is provided by system calls. System calls are usually made when a process in user mode requires access to a resource. Then it request...