Course10610523472 lectures
Programming in Modern C++
Prof. Partha Pratim Das · IIT Kharagpur
About
There has been a continual debate on which programming language/s to learn, to use. As the latest TIOBE Programming Community Index for August 2021 indicates – C (13%), Python (12%), C++ (7%), Java (10%), and C#(5%) together control nearly half the programming activities worldwide. Further, C Programming Language Family (C, C++, C#, Objective C etc.) dominate more than 25% of activities. Hence, learning C++ is important as one learns about the entire family, about Object-Oriented Programming and gets a solid foundation to also migrate to Java and Python as needed. C++ is the mother of most general purpose of languages. It is multi-paradigm encompassing procedural, object-oriented, generic, and even functional programming. C++ has primarily been the systems language till C++03 which punches efficiency of the code with the efficacy of OOP. Then, why should I learn it if my primary focus is on applications? This is where the recent updates of C++, namely, C++11 and several later offer excellent depths and flexibility for C++ that no language can match. These extensions attempt to alleviate some of the long-standing shortcomings for C++ including porous resource management, error-prone pointer handling, expression semantics, and better readability. The present course builds up on the knowledge of C programming and basic data structure (array, list, stack, queue etc.) to create a strong familiarity with C++98 / C++03. Besides the constructs, syntax and semantics of C++ (over C), we also focus on various idioms of C++ and attempt to go to depth with every C++ feature justifying and illustrating them with several examples and assignment problems. On the way, we illustrate various OOP concepts. The course also covers important advances in C++11 and later released features.
Prerequisites: Programming & Data Structure (mandatory), Programming in C (optional). Design and Analysis of Algorithms (optional).
Lectures
Week 1
- Lecture 01 : Course Overview
- Lecture 02 : IO & Loop
- Lecture 03 : Arrays and Strings
- Lecture 04 : Sorting and Searching
- Lecture 05 : Stack and Common Data Structures / Containers
- Tutorial 01 : How to build a C/C++ program?: Part 1: C Preprocessor (CPP)
Week 2
- Lecture 06 : Constants and Inline Functions
- Lecture 07 : Reference & Pointer
- Lecture 08 : Default Parameters & Function Overloading
- Lecture 09 : Operator Overloading
- Lecture 10 : Dynamic Memory Management
- Tutorial 02 : How to build a C/C++ program?: Part 2: Build Pipeline
Week 3
- Lecture 11 : Classes and Objects
- Lecture12 : Access Specifiers
- Lecture 13 : Constructors, Destructors & Object Lifetime
- Lecture 14 : Copy Constructor and Copy Assignment Operator
- Lecture 15 : Const-ness
- Tutorial 03 : How to build a C/C++ program?: Part 3: make Utility
Week 4
- Lecture 16 : Static Members
- Lecture 17 : Friend Function and friend Class
- Lecture 18 : Overloading Operator for User-Defined Types: Part 1
- Lecture 19 : Overloading Operator for User-Defined Types: Part 2
- Lecture 20 : Namespace
- Tutorial 04 : How to build a C/C++ program?: Part 4: Static and Dynamic Library
Week 5
- Lecture 21 : Inheritance: Part 1 (Inheritance Semantics)
- Lecture 22 : Inheritance: Part 2 (Data Member & Member Function - Override & Overload)
- Lecture 23 : Inheritance: Part 3 (Constructor & Destructor - Object Lifetime)
- Lecture 24 : Inheritance: Part 4: Phone Hierarchy
- Lecture 25 : Inheritance: Part 5: private & protected Inheritance
- Tutorial 05 : Mixing C and C++ Code: Part 1: Issues and Resolutions
Week 6
- Lecture 26 : Polymorphism: Part 1: Type Casting
- Lecture 27 : Polymorphism: Part 2: Static and Dynamic Binding
- Lecture 28 : Polymorphism: Part 3: Abstract Base Class
- Lecture 29 : Polymorphism: Part 4: Staff Salary Processing using C
- Lecture 30 : Polymorphism: Part 5: Staff Salary Processing using C++
- Tutorial 06 : Mixing C and C++ Code: Part 2: Project Example
Week 7
- Lecture 31 : Virtual Function Table
- Lecture 32 : Type Casting & Cast Operators: Part 1
- Lecture 33 : Type Casting & Cast Operators: Part 2
- Lecture 34 : Type Casting & Cast Operators: Part 3
- Lecture 35 : Multiple Inheritance
- Tutorial 07 : How to design a UDT like built-in types?: Part 1: Fraction UDT
Week 8
- Lecture 36 : Exceptions (Error handling in C): Part 1
- Lecture 37 : Exceptions (Error handling in C++): Part 2
- Lecture 38 : Template (Function Template): Part 1
- Lecture 39 : Template (Class Template): Part 2
- Lecture 40 : Functors: Function Objects
- Tutorial 08 : How to design a UDT like built-in types?: Part 2: Int and Poly UDT
Week 9
- Lecture 41 : Input-Output: File Handling in C
- Lecture 42 : Input-Output: Streams in C++
- Lecture 43 : C++ Standard Library: Part 1 (Generic Programming)
- Lecture 44 : C++ Standard Library: Part 2 (STL)
- Lecture 45 : C++ Standard Library: Part 3 (STL)
- Tutorial 09 : How to design a UDT like built-in types?: Part 3: Updates and Mixes of UDTs
Week 10
- Lecture 46 : C++11 and beyond: General Features: Part 1
- Lecture 47 : C++11 and beyond: General Features: Part 2
- Lecture 48 : C++11 and beyond: General Features: Part 3
- Lecture 49 : C++11 and beyond: General Features: Part 4: Rvalue and Move/1
- Lecture 50 : C++11 and beyond: General Features: Part 5: Rvalue and Move/2
- Tutorial 10 : How to optimize C++11 programs using Rvalue and Move Semantics?
Week 11
- Lecture 51 : C++11 and beyond: General Features: Part 6: Rvalue & Perfect Forwarding
- Lecture 52 : C++11 and beyond: General Features: Part 7: Lambda in C++/1
- Lecture 53 : C++11 and beyond: General Features: Part 8: Lambda in C++/2
- Lecture 54 : C++11 and beyond: Class Features
- Lecture 55 : C++11 and beyond: Non-class Types and Template Features
- Tutorial 11 : Compatibility of C and C++: Part 1: Significant Features
Week 12
- Lecture 56 : C++11 and beyond: Resource Management by Smart Pointers: Part 1
- Lecture 57 : C++11 and beyond: Resource Management by Smart Pointers: Part 2
- Lecture 58 : C++11 and beyond: Concurrency: Part 1
- Lecture 59 : C++11 and beyond: Concurrency: Part 2
- Lecture 60 : Closing Comments
- Tutorial 12 : Compatibility of C and C++: Part 2: Summary
Syllabus and materials
At NPTEL, as the course publishes them.
Credits and licence
- Institution
- IIT Kharagpur
- Department
- Computer Science and Engineering
- Teacher
- Prof. Partha Pratim Das
- Level
- Undergraduate
- Language
- English
- Subjects
- Computer science, Engineering
- Source
- NPTEL
- Licence
- CC BY-NC-SA, as NPTEL states it. Non-commercial use only. NPTEL's terms
- Attribution
- NPTEL states: "Distributed under Creative Commons Attribution-ShareAlike / CC BY - NC - SA", beside a BY-NC-SA badge.
- Who can watch
- NPTEL gives no rating. Invisible Network shows it to Tweens profiles and older, judged from what the source says about it. How courses are placed