C++ is a general-purpose programming language and is widely used nowadays for competitive programming. It has imperative, object-oriented and generic programming features. C++ runs on lots of platforms like Windows, Linux, Unix, Mac etc.
Basics
- Setting up C++
- Development Environment
- Writing first C++ program(Practice)
- void main or main()
- C++ Data Types(Practice)
- Basic Input/Output
- Response on exceeding valid range of data types
- C++ Preprocessors
- Operators in C++(Practice)
- Loops (Practice)
- Decision Making in C++(Practice)
- Execute both if and else simultaneously
- How to compile 32-bit program on 64-bit gcc in C and C++
- Switch statement in C++(Practice)
- Functions in C++(Practice)
- Arrays in C/C++(Practice)
- Strings in C++(Practice)
- Pointers in C++(Practice)
- References in C++
- Introduction to OOP in C++
C vs C++
- C program that won’t compile in C++
- Undefined Behaviour in C and C++
- Name Mangling and extern “C” in C++
- void * in C vs C++
- Program that produces different results
- in C and C++
- Type difference of character literals in C vs C++
- Difference between Structures in C and C++
C++ vs Java
- Inheritance in C++ vs Java
- static keyword in C++ vs Java
- default virtual behavior in C++ vs Java
- Exception Handling in C++ vs Java
- Foreach in C++ vs Java
- Templates in C++ vs Generics in Java
- Floating Point Operations & Associativity in C, C++ and Java
- Similarities between Java and C++
Input and output
- I/O Redirection in C++
- Clearing The Input Buffer
- Basic Input/Output(Practice)
- cout << endl vs cout << “\n” in C++
- Problem with scanf() when there is fgets()/gets()/scanf() after it
- How to use getline() in C++ when there are blank lines in input?
- scanf() and fscanf() in C – Simple Yet Poweful
- Using return value of cin to take unknown number of inputs in C++
- How to change the output of printf() in main() ?
- Implementation of a Falling Matrix
- What does buffer flush means in C++ ?
- kbhit in C language
- Code to generate the map of India
Operators
- Operators in C++
- Unary operators in C/C++
- Conditionally assign a value without
- using conditional and arithmetic operators
- Execution of printf with ++ operators
- Set a variable without using
- Arithmetic, Relational or Conditional Operator
- Scope Resolution Operator vs this pointer
- Pre-increment (or pre-decrement)
- new and delete operator in C++
- CHAR_BIT in C
- Casting operators| Set 1 (const_cast)
Arrays and Strings
- Arrays in C/C++
- Array of Strings
- Multidimensional arrays in C/C++
- Raw string literal
- Counts of distinct consecutive sub-string
- of length two
- Converting string to number and vice-versa
- Find size of array in C/C++ without using sizeof
- How to quickly reverse a string in C++?
- Tokenizing a string in C++
- Getline() function and character array
- Convert string to char array in C++
- C++ string class and its applications , Set 2
- How to create a dynamic 2D array inside a class in C++ ?
- Lexicographically next permutation
- Print size of array parameter
- Split a string in C/C++, Python and Java
- Stringstream in C++ and its applications
- Strchr() function in C/C++
- Isspace() in C/C++ and its application to count whitespace characters
- Char* vs std:string vs char[] in C++
- Std::lexicographical_compare() in C++STL
- Std::string::at in C++
- Std::substr() in C/C++
- std::stol() and std::stoll() functions in C++
- Extract all integers from string in C++
- Strchr() function in C++ and its applications
- Strcat() vs strncat() in C++
- Strncat() function in C/C++
- Strpbrk() in C
- strcoll() in C/C++
- Why strcpy and strncpy are not safe to use?
Functions
- Functions in C++
- Default Arguments
- C function argument and return values
- Inline Functions
- Return from void functions
- Returning multiple values from a function
- using Tuple and Pair
- Function Call Puzzle
- Functors
- Ciel and floor functions in C++
- Const member functions
- atol(), atoll() and atof() functions in C/C++
- swap() in C++
- wmemmove() function in c++
- wcscat() function in C++
- wcscmp() function in C++ with Examples
- wcscpy() function in C++ with Examples
- wcslen() function in C++ with Examples
- difftime() function in C++
- asctime() function in C++
- localtime() function in C++
- scalbn() function in C++
- isunordered() function in C++
- isnormal() in C++
- isinf() function in C++
- quick_exit() function in C++ with Examples
- ctime() Function in C/C++
- clock() function in C/C++
- nearbyint() function in C++
- quick_exit() function in C++ with Examples
- wcscmp() function in C++ with Examples
- wcscpy() function in C++ with Examples
- wcslen() function in C++ with Examples
Pointers and References
- Pointers in C and C++
- What is Array Decay in C++? How can
- it be prevented?
- Opaque Pointer
- References
- Can references refer to invalid location?
- Pass arguments by reference or pointer
- Smart Pointers
- ‘this’ pointer
- Type of ‘this’ pointer
- “delete this”
- auto_ptr, unique_ptr, shared_ptr and weak_ptr
- Dangling, Void , Null and Wild Pointers
- Passing by pointer Vs Passing by Reference
- NaN in C++ – What is it and how to check for it?
- nullptr
- Pointers vs References in C++
Dynamic memory allocation
- new and delete operator in C++
- malloc() vs new
- delete() and free()
- Std::get_temporary_buffer in C++
Object Oriented Programming(OOP)
- Object oriented design
- Introduction to OOP in C++
- Classes and Objects
- Access Modifiers
- Inheritance
- Polymorphism
- Encapsulation
- Data Abstraction
- Structure vs class
- Can a C++ class have an object of self type?
- Why is the size of an empty class not zero?
- Static data members in C++
- Some interesting facts about static member functions
- Friend class and function
- Local Class
- Nested Classes
- Simulating final class
Constructor and Destructor
- Constructors
- Copy Constructor
- Destructors
- Does compiler create default constructor
- when we write our own?
- When should we write our
- own copy constructor?
- When is copy constructor called?
- Initialization of data members
- Use of explicit keyword
- When do we use Initializer List in?
- Default Constructors
- Private Destructor
- Playing with Destructors
- Copy elision
- C++ default constructor | Built-in types
- When does compiler create a
- default constructor and copy constructor?
- Why copy constructor argument should be
- const in C++?
- Advanced C++ | Virtual Constructor
- Advanced C++ | Virtual Copy Constructor
- When are static objects destroyed?
- Is it possible to call constructor
- and destructor explicitly?
Function Overloading
- Function Overloading
- Functions that can’t be overloaded
- Function overloading and const keyword
- Function overloading and return type
- Does overloading work with Inheritance?
- Can main() be overloaded
- Function Overloading and float
Operator Overloading
- Operator Overloading
- Copy constructor vs assignment operator
- When should we write our
- own assignment operator?
- Operators that cannot be overloaded
- Conversion Operators
- Is assignment operator inherited?
- Default Assignment Operator and References
- Overloading stream insertion (<<)
- and extraction (>>) operators
- Overloading array index operator [ ]
Virtual Functions
- Virtual Functions and Runtime Polymorphism
- Default arguments and virtual function
- Virtual functions in derived classes
- Can static functions be virtual?
- Virtual Destructor
- Virtual Constructor
- Virtual Copy Constructor
- RTTI (Run-time type information)
- Can virtual functions be private?
- Inline virtual function
- Pure Virtual Functions and Abstract Classes
- Pure virtual destructor
Exception Handling
- Exception Handling Basics
- Stack Unwinding
- Catching base and derived classes as exceptions
- Catch block and type conversion
- Exception handling and object destruction
Namespace
- Namespace in C++ | Set 1 (Introduction)
- Set 2 (Extending namespace and
- Unnamed namespace)
- Namespace in C++ | Set 3 (Accessing,
- creating header, nesting and aliasing)
- Inline namespaces and usage of the
- “using” directive inside namespaces
- Can namespaces be nested?
Standard Template Library (STL)
Algorithms
- Introduction to STL
- Sorting
- Searching
Containers:
- Pair (Practice)
- Vector (Practice)
- Ways to copy a vector in C++
- Sorting 2D Vector in C++ | Set 3 (By number of columns),(Sort in descending order by first and second)
- Sorting 2D Vector in C++ | Set 2 (In descending order by row and column)
- 2D vector in C++ with user defined size
- Vector::clear() and vector::erase() in C++ STL
- Passing vector to a function in C++
- Vector::push_back() and vector::pop_back() in C++ STL
- Vector::empty() and vector::size() in C++ STL
- vector::front() and vector::back() in C++ STL
- Initialize a vector; Different ways
- Sorting 2D Vector in C++ | Set 1 (By row and column), (Sort by first and second)
- Computing index using pointers returned by STL functions in C++
- List
- List in C++ | Set 2 (Some Useful Functions)
- Forward List in C++ | Set 1 (Introduction and Important Functions)
- Forward List in C++ | Set 2 (Manipulating Functions)
- list::remove() and list::remove_if() in C++ STL
- Forward_list::front() and forward_list::empty() in C++ STL
- Forward_list::remove() and forward_list::remove_if() in C++ STL
- forward_list::unique() in C++ STL
- forward_list::reverse() in C++ STL
- forward_list::max_size() in C++ STL
- forward_list::before_begin() in C++ STL
- forward_list::cbefore_begin() in C++ STL
- forward_list::unique() in C++ STL
- forward_list::before_begin() in C++ STL
- forward_list::cbefore_begin() in C++ STL
- forward_list::reverse() in C++ STL
- forward_list::max_size() in C++ STL
- forward_list::splice_after() in C++ STL
- list::empty() and list::size() in C++ STL
- list::front() and list::back() in C++ STL
- list::pop_front() and list::pop_back() in C++ STL
- list::push_front() and list::push_back() in C++ STL
- list push_front() function in C++ STL
- list pop_back() function in C++ STL
- list pop_front() function in C++ STL
- list reverse function in C++ STL
- list resize() function in C++ STL
- list size() function in C++ STL
- list max_size() function in C++ STL
- Dequeue
- Deque::empty() and deque::size() in C++ STL
- Deque::pop_front() and deque::pop_back() in C++ STL
- Deque::clear() and deque::erase() in C++ STL
- Queue (Practice)
- Queue::front() and queue::back() in C++ STL
- Queue::push() and queue::pop() in C++ STL
- queue::empty() and queue::size() in C++ STL
- Priority Queue
- Stack (Practice)
- Stack::push() and stack::pop() in C++ STL
- Forward_list :: push_front() and forward_list :: pop_front() in C++ STL
- Stack::top() in C++ STL
- Stack::empty() and stack::size() in C++ STL
- Set (Practice)
- Count number of unique Triangles using STL | Set 1 (Using set)
- std::istream_iterator and std::ostream_iterator in C++ STL
- Std::next_permutation and prev_permutation in C++
- Std::stoul and std::stoull in C++
- Shuffle vs random_shuffle in C++
- Difference between set, multiset, unordered_set, unordered_multiset
- Check if a key is present in a C++ map or unordered_map
- Std::stable_partition in C++
- Valarray slice selector
- Std::memchr in C++
- Std::strncmp() in C++
- Stable_sort() in C++ STL
- Std::memcmp() in C++
- Std::memset in C++
- Std::bucket_count and std::bucket_size in unordered_map in C++
- Map of pairs in STL
- Range-based for loop in C++
- Std::includes() in C++ STL
- Std::set_symmetric_difference in C++
- Std::sort_heap in C++
- Map vs unordered_map in C++
- Round() in C++
- Modulus of two float or double numbers
- Multiset
- Map (Practice)
- Heap using STL C++
- Ways to copy a vector in C++
- Sorting 2D Vector in C++ | Set 3 (By number of columns),(Sort in descending order by first and second)
- Sorting 2D Vector in C++ | Set 2 (In descending order by row and column)
- 2D vector in C++ with user defined size
- Vector::clear() and vector::erase() in C++ STL
- Passing vector to a function in C++
- Vector::push_back() and vector::pop_back() in C++ STL
- Vector::empty() and vector::size() in C++ STL
- vector::front() and vector::back() in C++ STL
- Initialize a vector; Different ways
- Sorting 2D Vector in C++ | Set 1 (By row and column), (Sort by first and second)
- Computing index using pointers returned by STL functions in C++
- List in C++ | Set 2 (Some Useful Functions)
- Forward List in C++ | Set 1 (Introduction and Important Functions)
- Forward List in C++ | Set 2 (Manipulating Functions)
- list::remove() and list::remove_if() in C++ STL
- Forward_list::front() and forward_list::empty() in C++ STL
- Forward_list::remove() and forward_list::remove_if() in C++ STL
- forward_list::unique() in C++ STL
- forward_list::reverse() in C++ STL
- forward_list::max_size() in C++ STL
- forward_list::before_begin() in C++ STL
- forward_list::cbefore_begin() in C++ STL
- forward_list::unique() in C++ STL
- forward_list::before_begin() in C++ STL
- forward_list::cbefore_begin() in C++ STL
- forward_list::reverse() in C++ STL
- forward_list::max_size() in C++ STL
- forward_list::splice_after() in C++ STL
- list::empty() and list::size() in C++ STL
- list::front() and list::back() in C++ STL
- list::pop_front() and list::pop_back() in C++ STL
- list::push_front() and list::push_back() in C++ STL
- list push_front() function in C++ STL
- list pop_back() function in C++ STL
- list pop_front() function in C++ STL
- list reverse function in C++ STL
- list resize() function in C++ STL
- list size() function in C++ STL
- list max_size() function in C++ STL
- Count number of unique Triangles using STL | Set 1 (Using set)
- std::istream_iterator and std::ostream_iterator in C++ STL