Please find recent Articles on C/C++ here !!

C vs C++, C++ vs JavaBasics, Operators, Arrays and StringsReferences and Pointers, Functions, NamespacesFunction Overloading, Operator Overloading, Virtual Functions, Exception HandlingClass and Object, Constructor and Destructor, PuzzlesInheritance, Standard Template Library (STL)Special Members , Inheritance , C++ LibraryC++ AdvancedInput and Output, C++ in Competitive ProgrammingOutput Questions, Quizzes on C++

 C vs C++

  1. C program that won’t compile in C++
  2. Name Mangling and extern “C” in C++
  3. void * in C vs C++
  4. Program that produces different results
    in C and C++
  5. Type difference of character literals in C vs C++

C++ vs Java

  1. Inheritance in C++ vs Java
  2. static keyword in C++ vs Java
  3. default virtual behavior  in C++ vs Java
  4. Exception Handling in C++ vs Java
  5. Foreach in C++ vs Java
  6. Floating Point Operations
    & Associativity in C, C++ and Java


  1. void main or main()
  2. Loops


  1. Conditionally assign a value without
    using conditional and arithmetic operators
  2. Execution of printf with ++ operators
  3. Set a variable without using
    Arithmetic, Relational or Conditional Operator
  4. Scope Resolution Operator vs this pointer
  5. Pre-increment (or pre-decrement)

Arrays and Strings

  1. Array of Strings
  2. Raw string literal
  3. Counts of distinct consecutive sub-string
    of length two
  4. Converting string to number and vice-versa
  5. Find size of array in C/C++ without using sizeof 
  6. How to quickly reverse a string in C++?
  7. C++ string class and its applications , Set 2
  8. How to create a dynamic 2D array inside a class in C++ ?
  9. Lexicographically next permutation
  10. Print size of array parameter 
  11. Split a string in C/C++, Python and Java

References and Pointers

  1. Pointers in C and C++ 
  2. What is Array Decay in C++? How can
    it be prevented?
  3. Opaque Pointer
  4. References 
  5. Can references refer to invalid location?
  6. Pass arguments by reference or pointer
  7. Smart Pointers
  8. ‘this’ pointer
  9. Type of ‘this’ pointer
  10. “delete this” 
  11. auto_ptr, unique_ptr, shared_ptr and weak_ptr
  12. Dangling, Void , Null and Wild Pointers
  13. Passing by pointer Vs Passing by Reference
  14. NaN in C++ – What is it and how to check for it?
  15. nullptr


  1. Inline Functions
  2. Return from void functions
  3. Returning multiple values from a function
    using Tuple and Pair
  4. Function Call Puzzle
  5. Functors


  1. Namespace in C++ | Set 1 (Introduction)
  2. Set 2 (Extending namespace and
    Unnamed namespace)
  3. Namespace in C++ | Set 3 (Accessing,
    creating header, nesting and aliasing)
  4. Inline namespaces and usage of the
    “using” directive inside namespaces
  5. Namespacef
  6. Can namespaces be nested?

Function Overloading

  1. Function Overloading
  2. Functions that can’t be overloaded 
  3. Function overloading and const keyword
  4. Function overloading and return type
  5. Does overloading work with Inheritance?
  6. Can main() be overloaded
  7. Function Overloading and float

Operator Overloading

  1. Operator Overloading
  2. Copy constructor vs assignment operator
  3. When should we write our
    own assignment operator?
  4. Operators that cannot be overloaded 
  5. Conversion Operators
  6. Is assignment operator inherited?
  7. Default Assignment Operator and References
  8. Overloading stream insertion (<<)
    and extraction (>>) operators
  9. Overloading array index operator []

Virtual Functions

  1. Virtual Functions and Runtime Polymorphism
  2. Default arguments and virtual function
  3. Virtual functions in derived classes
  4. Can static functions be virtual?
  5. Virtual Destructor
  6. Virtual Constructor
  7. Virtual Copy Constructor
  8. RTTI (Run-time type information)
  9. Can virtual functions be private?
  10. Inline virtual function
  11. Pure Virtual Functions and Abstract Classes
  12. Pure virtual destructor

Exception Handling

  1. Exception Handling Basics
  2. Stack Unwinding 
  3. Catching base and derived classes as exceptions
  4. Catch block and type conversion
  5. Exception handling and object destruction

Class and Object

  1. Introduction to Object Oriented Programming 
  2. Structure vs class
  3. Can a C++ class have an object of self type?
  4. Why is the size of an empty class not zero?

Constructor and Destructor

  1. Constructors
  2. Copy Constructor
  3. Destructors
  4. Does compiler create default constructor
    when we write our own?
  5. When should we write our
    own copy constructor?
  6. When is copy constructor called?
  7. Initialization of data members
  8. When do we use Initializer List in?
  9. Default Constructors
  10. Private Destructor
  11. Playing with Destructors
  12. Copy elision
  13. C++ default constructor | Built-in types
  14. When does compiler create a
    default constructor and copy constructor?
  15. Why copy constructor argument should be
    const in C++?
  16. Advanced C++ | Virtual Constructor
  17. Advanced C++ | Virtual Copy Constructor
  18. Default Constructors 
  19. When are static objects destroyed?
  20. Is it possible to call constructor
    and destructor explicitly?


  1. Can we call an undeclared function in?
  2. Can we access global variable if there
    is a local variable with same name?
  3. Can we use function on left side
    of an expression in C and C++?
  4. Can we access private data members
    of a class without using a member
    or a friend function?
  5. How to make a C++ class whose objects
    can only be dynamically allocated?
  6. How to print “GeeksforGeeks” with
    empty main()
  7. Print 1 to 100, without loop and recursion
  8. How to restrict dynamic allocation of objects
  9. Sum of digits of a number in single statement
  10. Write a URL in a C++ program
  11. Zoom digits of an integer
  12. Printing pyramid pattern
  13. How to swap two variables in one line in C/C++, Python and Java?

Standard Template Library (STL)


  1. Introduction to STL
  2. Sorting
  3. Searching


  1. Pair
  2. Vector
  3. List
  4. Dequeue
  5. Queue
  6. Priority Queue
  7. Stack
  8. Set
  9. Multiset
  10. Map
  11. Multimap
  12. Heap using STL C++


  1. sort() in C++ STL
  2. Type Inference in C++ (auto and decltype)
  3. transform() in C++ STL
  4. Variadic function templates in C++
  5. Template Specialization

Special Members

  1. Default Arguments
  2. malloc() vs new
  3. delete() and free()
  4. Some interesting facts about static member functions
  5. Static data members in
  6. Friend class and function
  7. Inheritance and friendship
  8. Use of explicit keyword
  9. Local Class
  10. Nested Classes
  11. Casting operators| Set 1 (const_cast)
  12. Simulating final class
  13. Const member functions


C++ Library

  1. <random> file – generators and distributions
  2. Array type manipulation
  3. C program to demonstrate fork() and pipe()
  4. Complex numbers in C++ | Set 1 Set 2
  5. Inbuilt library functions for user Input
  6. Chrono
  7. valarray class
  8. Floating Point Manipulation (fmod(), remainder(), remquo() … in cmath)
  9. Character Classification: cctype
  10. Socket Programming
  11. Precision of floating point numbers in C++ (floor(), ceil(), trunc(), round() and setprecision())
  12. <bit/stdc++.h> header file
  13. std::string class in C++
  14. Merge operations using STL in C++ (merge, includes, set_union, set_intersection, set_difference, ..)
  15. std::partition in C++ STL
  16. Ratio Manipulations in C++ | Set 1 (Arithmetic) , Set 2 (Comparison)
  17. numeric header in C++ STL | Set 1 (accumulate() and partial_sum()) Set 2 (adjacent_difference(), inner_product() and iota())
  18. Bind function and placeholders
  19. Array class
  20. Tuples
  21. Regex (Regular Expression)
  22. Common Subtleties in  Vector STLs
  23. Understanding constexpr specifier
  24. unordered_multiset and its uses
  25. unordered_multimap and its application
  26. Populating a vector in C++ using fill() and fill_n()
  27. Writing OS Independent Code in C/C++
  28. Database Connectivity using C/C++
  29. C++ bitset and its application
  30. unordered_map in STL and its applications
  31. unorderd_set in STL and its applications
  32. nextafter() and nexttoward()

C++ Advanced

  1. User Defined Literal
  2. Placement new operator
  3. Advanced C++ with boost library
  4. Copy-and-Swap Idiom
  5. Zombie and Orphan Processes
  6. Lambda expression

Input and output

  1. Clearing The Input Buffer
  2. cout << endl vs cout << “\n” in C++
  3. Problem with scanf() when there is fgets()/gets()/scanf() after it
  4. How to use getline() in C++ when there are blank lines in input?
  5. scanf() and fscanf() in C – Simple Yet Poweful
  6. How to change the output of printf() in main() ?
  7. Implementation of a Falling Matrix
  8. Code to generate the map of India

C++ in Competitive Programming

  1. Writing C/C++ code efficiently in Competitive programming
  2. Useful Array algorithms in C++ STL
  3. Data Type Ranges and their macros
  4. Cin-Cout vs Scanf-Printf
  5. getchar_unlocked() – faster input in C/C++ for Competitive Programming
  6. C qsort() vs C++ sort()
  7. Generating Test Cases (generate() and generate_n()

Output Questions:

  1. Set 1
  2. Set 2
  3. Set 3
  4. Set 4
  5. Set 5
  6. Set 6
  7. Set 7
  8. Set 8
  9. Set 9
  10. Set 10
  11. Set 11
  12. Set 12
  13. Set 13
  14. Set 14
  15. Set 15
  16.  Set 16
  17. Set 17
  18. Set 18
  19. Commonly Asked C++ Interview Questions | Set 1
  20. Commonly Asked OOP Interview Questions | Set 1
  21. C/C++ Programs

Quizzes on C++

  1. References
  2. Class and Object
  3. Constructors
  4. Destructors
  5. Operator Overloading
  6. this pointer
  7. new and delete
  8. Function Overloading and Default Arguments
  9. Static Keyword
  10. friend keyword
  11. Inheritance
  12. const keyword
  13. Virtual Functions
  14. Templates
  15. Exception Handling
  16. Misc C++

Company Wise Coding Practice    Topic Wise Coding Practice