C++ Programming Language

  • Last Updated : 24 Nov, 2021

C++ programming tutorial
C++ is a general purpose programming language and widely used now a days for competitive programming. It has imperative, object-oriented and generic programming features. C++ runs on lots of platform like Windows, Linux, Unix, Mac etc.

C++ Recent Articles!

Basics, C vs C++, C++ vs Java, Input and Output, Operators, Arrays and Strings, Functions, References and Pointers, Dynamic memory allocation, Object Oriented Programming(OOP),Constructor and Destructor, Function Overloading, Operator Overloading, Virtual Functions, Exception Handling, Namespaces, Standard Template Library (STL), Inheritance, C++ Library, C++ Advanced, C++ in Competitive Programming, Puzzles, Interview Questions, Multiple Choice Questions


C vs C++

C++ vs Java

Input and output


Arrays and Strings


Pointers and References

Dynamic memory allocation

Object Oriented Programming(OOP)

Constructor and Destructor

Function Overloading

Operator Overloading

Virtual Functions

Exception Handling


Standard Template Library (STL)

  1. Introduction to STL
  2. Sorting
  3. Searching


  1. Pair (Practice)
  2. Vector (Practice)
  3. List
  4. Dequeue
  5. Deque::empty() and deque::size() in C++ STL
  6. Deque::pop_front() and deque::pop_back() in C++ STL
  7. Deque::clear() and deque::erase() in C++ STL
  8. Queue (Practice)
  9. Queue::front() and queue::back() in C++ STL
  10. Queue::push() and queue::pop() in C++ STL
  11. queue::empty() and queue::size() in C++ STL
  12. Priority Queue
  13. Stack (Practice)
  14. Stack::push() and stack::pop() in C++ STL
  15. Forward_list :: push_front() and forward_list :: pop_front() in C++ STL
  16. Stack::top() in C++ STL
  17. Stack::empty() and stack::size() in C++ STL
  18. Set (Practice)
  19. Std::next_permutation and prev_permutation in C++
  20. Std::stoul and std::stoull in C++
  21. Shuffle vs random_shuffle in C++
  22. Difference between set, multiset, unordered_set, unordered_multiset
  23. Check if a key is present in a C++ map or unordered_map
  24. Std::stable_partition in C++
  25. Valarray slice selector
  26. Std::memchr in C++
  27. Std::strncmp() in C++
  28. Stable_sort() in C++ STL
  29. Std::memcmp() in C++
  30. Std::memset in C++
  31. Std::bucket_count and std::bucket_size in unordered_map in C++
  32. Map of pairs in STL
  33. Range-based for loop in C++
  34. Std::includes() in C++ STL
  35. Std::set_symmetric_difference in C++
  36. Std::sort_heap in C++
  37. Map vs unordered_map in C++
  38. Round() in C++
  39. Modulus of two float or double numbers
  40. Multiset
  41. Map (Practice)
  42. Heap using STL C++




  1. sort() in C++ STL
  2. Strand sort
  3. Type Inference in C++ (auto and decltype)
  4. transform() in C++ STL
  5. Variadic function templates in C++
  6. Template Specialization
  7. Implementing iterator pattern of a singly linked list
  8. Binary Search functions in C++ STL
  9. Descending order in Map and Multimap of C++ STL
  10. Insertion and Deletion in STL Set C++
  11. set::key_comp() in C++ STL
  12. set value_comp() function in C++ STL
  13. unordered_set get_allocator() in C++ STL with Examples


C++ Library

  1. <random> file – generators and distributions
  2. Array type manipulation
  3. C++ programming and STL facts
  4. Sqrt, sqrtl and sqrtf in C++
  5. std::stod, std::stof, std::stold in C++
  6. C program to demonstrate fork() and pipe()
  7. Complex numbers in C++ | Set 1 Set 2
  8. Inbuilt library functions for user Input
  9. Rename function in C/C++
  10. Chrono
  11. valarray class
  12. Floating Point Manipulation (fmod(), remainder(), remquo() … in cmath)(Practice)
  13. Character Classification: cctype
  14. Snprintf() in C library
  15. Boost::split in C++ library
  16. Modulus of two float or double numbers
  17. Is_trivial function in C++
  18. Array sum in C++ STL
  19. Div() function in C++
  20. Exit() vs _Exit() in C and C++
  21. Std::none_of in C++
  22. Isprint() in C++
  23. Iscntrl() in C++ and its application to find control characters
  24. Std::partition_point in C++
  25. Iterator Invalidation in C++
  26. Fesetround() and fegetround() in C++ and their application
  27. Rint(), rintf(), rintl() in C++
  28. Hypot(), hypotf(), hypotl() in C++
  29. Std::gslice | Valarray generalized slice selector
  30. std::setbase, std::setw , std::setfill in C++
  31. Strxfrm() in C/C++
  32. Set position with seekg() in C++ language file handling
  33. Strstr() in C/C++
  34. Difftime() C library function
  35. Socket Programming
  36. Precision of floating point numbers in C++ (floor(), ceil(), trunc(), round() and setprecision())
  37. <bit/stdc++.h> header file
  38. std::string class in C++
  39. Merge operations using STL in C++ (merge, includes, set_union, set_intersection, set_difference, ..)
  40. std::partition in C++ STL
  41. Ratio Manipulations in C++ | Set 1 (Arithmetic) , Set 2 (Comparison)
  42. numeric header in C++ STL | Set 1 (accumulate() and partial_sum()), Set 2 (adjacent_difference(), inner_product() and iota())
  43. Bind function and placeholders
  44. Array class
  45. Tuples
  46. Regex (Regular Expression)
  47. Common Subtleties in Vector STLs
  48. Understanding constexpr specifier
  49. unordered_multiset and its uses
  50. unordered_multimap and its application
  51. Populating a vector in C++ using fill() and fill_n()
  52. Writing OS Independent Code in C/C++
  53. C Program to display hostname and IP address
  54. Database Connectivity using C/C++
  55. C++ bitset and its application
  56. unordered_map in STL and its applications
  57. unorderd_set in STL and its applications
  58. nextafter() and nexttoward()

C++ Advanced

C++ in Competitive Programming


Interview Questions

Quick Links:

  • Recent Articles on C++
  • Practice Track on C++
  • C++ Output & Multiple Choice Questions
  • Geeksforgeeks Courses:

    1. Language Foundation Courses [C++ / JAVA / Python ]
    Learn any programming language from scratch and understand all its fundamentals concepts for a strong programming foundation in the easiest possible manner with help of GeeksforGeeks Language Foundation Courses – Java Foundation | Python Foundation | C++ Foundation

    2. Geeks Classes Live
    Get interview-centric live online classes on Data Structure and Algorithms from any geographical location to learn and master DSA concepts for enhancing your problem-solving & programming skills and to crack the interview of any product-based company – Geeks Classes: Live Session

    3. Complete Interview Preparation
    Get fulfilled all your interview preparation needs at a single place with the Complete Interview Preparation Course that provides you all the required stuff to prepare for any product-based, service-based, or start-up company at the most affordable prices.

    4. DSA Self Paced
    Start learning Data Structures and Algorithms to prepare for the interviews of top IT giants like Microsoft, Amazon, Adobe, etc. with DSA Self-Paced Course where you will get to learn and master DSA from basic to advanced level and that too at your own pace and convenience.

    5. Company Specific Courses – Amazon, Microsoft, TCS & Wipro
    Crack the interview of any product-based giant company by specifically preparing with the questions that these companies usually ask in their coding interview round. Refer GeeksforGeeks Company Specific Courses: Amazon SDE Test Series, etc.

    My Personal Notes arrow_drop_up

    Writing code in comment? Please use ide.geeksforgeeks.org, generate link and share the link here.