सामग्री पर जाएँ

C++ ट्यूटोरियल

Learn modern C++ from the basics to classes, templates, the STL, smart pointers, concurrency and C++23. Real code compiled in your browser, quizzes and projects.

Getting Started

  1. 1 C++ के साथ शुरुआत Learn what C++ is, where it's used and why it's still everywhere. Write, compile and run your first modern C++ program with std::println, right in your browser.
  2. 2 C++ कैसे काम करता है: कंपाइल और लिंक करना Follow C++ code from source to executable through the preprocessor, compiler and linker. Meet GCC, Clang, MSVC, C++ standards, warnings and UB.
  3. 3 C++ सिंटैक्स Learn the core rules of C++ syntax: main, statements, semicolons, blocks, #include, namespaces, std::, using declarations and reading compiler errors.
  4. 4 कमेंट Write clear C++ comments with // and /* */, document functions Doxygen-style, avoid the nesting and backslash traps, and learn which comments help.
  5. 5 Output प्रिंट करना Print text and values in C++ with std::println, std::print and format strings, use std::cout with <<, prefer '\n' to std::endl, and write to std::cerr.
  6. 6 यूज़र इनपुट पढ़ना Read numbers, words and whole lines in C++ with std::cin and std::getline, fix the leftover-newline bug, validate input and loop until input ends.
  7. 7 कीवर्ड और आइडेंटिफ़ायर See every C++ keyword grouped by purpose, learn the rules for valid identifiers, compare naming styles and avoid names reserved for the compiler.
  8. 8 vcpkg और Conan से Dependencies Learn how C++ package managers work. Use vcpkg manifests and Conan recipes with CMake, pin versions, understand triplets and profiles, and see how dependency resolution works.

Variables and Types

  1. 9 वेरिएबल (Variables) Declare and initialize C++ variables with =, () and {} braces, see why uninitialized variables are dangerous, assign new values and preview scope.
  2. 10 बुनियादी डेटा टाइप Learn the C++ fundamental types (bool, char, int, double, void), how big they really are with sizeof, fixed-width types from <cstdint> and numeric_limits.
  3. 11 इंटीजर टाइप (Integer Types) Master C++ integers - signed vs unsigned ranges, overflow (undefined vs wrapping), signed/unsigned comparison traps, std::size_t, and hex, binary and suffixed literals.
  4. 12 फ़्लोटिंग-पॉइंट संख्याएँ Learn C++ float, double and long double, why 0.1 + 0.2 != 0.3, how to compare floating-point values safely, NaN and infinity, and std::numbers constants.
  5. 13 कैरेक्टर और बूलियन Learn how C++ char really works (a small integer, signed or not), ASCII arithmetic, <cctype> pitfalls, char8_t/char16_t/char32_t, and bool conversions.
  6. 14 auto से टाइप डिडक्शन Learn exactly what C++ auto deduces, why it drops const and references, when to use auto&, const auto& and auto&&, how decltype differs, and when auto helps readability.
  7. 15 कॉन्स्टेंट: const, constexpr और consteval Learn C++ constants - const for values that never change, constexpr for compile-time values and functions, consteval and constinit, and why #define constants are a bad idea.
  8. 16 टाइप कन्वर्ज़न और कास्ट Learn how C++ converts types implicitly (promotions, arithmetic conversions), how brace init stops narrowing, how to use static_cast, and why C-style casts are risky.
  9. 17 Type Aliases: using और typedef Learn C++ type aliases with using and the legacy typedef, alias templates, member type aliases like value_type, and why an alias is not a new type.
  10. 18 Math फ़ंक्शन Use C++ math functions from <cmath> and <numeric>, pow, sqrt, rounding, trig, gcd, lcm, std::numbers, and integer division and remainder with negatives.

Operators

  1. 19 अरिथमेटिक ऑपरेटर Learn the C++ arithmetic operators + - * / %, integer vs floating-point division, the modulo operator, type promotion rules and how integer overflow bites.
  2. 20 असाइनमेंट और इंक्रीमेंट ऑपरेटर Master C++ assignment, compound assignment like += and *=, prefix vs postfix ++ and --, and the sequencing rules that make code like i = i++ so dangerous.
  3. 21 Comparison और Logical ऑपरेटर Compare values in C++ with == != < > <= >=, use the C++20 three-way comparison <=>, and combine conditions with &&, || and ! using short-circuit evaluation.
  4. 22 बिटवाइज़ ऑपरेटर Learn the C++ bitwise operators & | ^ ~ << >>: masks, setting and clearing bits, shift rules, enum flags, std::bitset and C++20 <bit> functions like popcount.
  5. 23 Operator Precedence और Conditional ऑपरेटर The full C++ operator precedence and associativity table, how evaluation order differs, the ?: conditional operator, the comma operator, sizeof and ::.

Strings

  1. 24 std::string से स्ट्रिंग्स Learn C++ std::string from scratch, creating and joining strings, size and length, indexing with [] and at(), comparing, and looping over text.
  2. 25 स्ट्रिंग मेथड A practical guide to C++ std::string methods: find and rfind, npos, substr, replace, insert, erase, append, starts_with, ends_with, contains, resize and c_str.
  3. 26 std::string_view Learn C++ std::string_view - cheap non-owning views of text, the best string parameter type, substr without copying, remove_prefix, and the dangling-view traps.
  4. 27 std::format और std::print से फ़ॉर्मेटिंग The complete guide to C++ std::format and std::println - width, fill, alignment, precision, signs, hex and binary, formatting vectors and maps, custom formatters, iomanip.
  5. 28 स्ट्रिंग और संख्याओं के बीच कन्वर्ज़न Convert between strings and numbers in C++ - std::to_string, stoi and stod with their exceptions, fast from_chars and to_chars, std::format, and safe parsing helpers.
  6. 29 C-स्टाइल स्ट्रिंग और कैरेक्टर ऐरे Understand C-style strings in C++ - char arrays, the null terminator, strlen, strcpy, strcmp and snprintf, buffer overflows, and converting to and from std::string.
  7. 30 लोकेल और यूनिकोड टेक्स्ट Understand how C++ handles text beyond ASCII. Use std::locale and facets for number formatting, work with UTF-8 bytes and code points, decode and validate text, and avoid common pitfalls.

Control Flow

  1. 31 if, else if और else Learn C++ if, else if and else - how conditions convert to bool, else-if chains, nesting and guard clauses, if with an initializer (C++17), if constexpr and common bugs.
  2. 32 switch स्टेटमेंट Learn the C++ switch statement - case labels, break and fall-through, [[fallthrough]], switching on enums, switch with an initializer, case scope rules and when to use it.
  3. 33 while और do-while लूप Learn C++ while and do-while loops - how conditions are checked, input loops that read until end of input, validation loops, infinite loops with break and loop bugs.
  4. 34 for लूप और रेंज-बेस्ड for Learn C++ for loops - classic counting loops, range-based for by value, reference and const reference, loops with an initializer (C++20), views::enumerate and nested loops.
  5. 35 break, continue और goto Learn how break and continue control C++ loops, how to exit nested loops cleanly with functions, flags and lambdas, and why goto is almost never the answer.

Arrays and Vectors

  1. 36 C-स्टाइल ऐरे Learn C-style arrays in C++ - declaring, initializing and indexing, why there is no bounds checking, how arrays decay to pointers, and when to use std::array instead.
  2. 37 std::array Learn std::array, the zero-cost fixed-size array of modern C++ - creating it, at() vs [], size(), fill, iteration, copying, comparison and passing it to functions.
  3. 38 std::vector Learn std::vector, the dynamic array of C++ - creating vectors, push_back and emplace_back, size vs capacity, reserve, insert and erase, iteration and common pitfalls.
  4. 39 बहु-आयामी ऐरे और मैट्रिक्स Store grids and matrices in C++ with 2D arrays, std::array of arrays, vector of vectors and fast flat vectors with index math, plus row-major order and std::mdspan.
  5. 40 std::span Learn std::span (C++20) - one function for C arrays, std::array and std::vector, read-only vs writable spans, subspan, fixed vs dynamic extent, and dangling-span pitfalls.

Functions

  1. 41 फ़ंक्शन Learn C++ functions - defining and calling them, return types and void, declarations vs definitions, how calls work, [[nodiscard]], and how to design small, clear functions.
  2. 42 पैरामीटर: वैल्यू, रेफ़रेंस और const रेफ़रेंस से पास करना Learn how to pass arguments in C++ - by value, by reference and by const reference, what each costs, output parameters and better alternatives, and passing strings and vectors.
  3. 43 डिफ़ॉल्ट आर्ग्युमेंट Learn C++ default arguments - giving parameters default values, the trailing-defaults rule, where to declare defaults, evaluation rules, and when overloads are better.
  4. 44 वैल्यू लौटाना (Returning Values) Return values the modern C++ way - return by value and copy elision, multiple results with structs, pairs, tuples and structured bindings, std::optional, and dangling references.
  5. 45 फ़ंक्शन ओवरलोडिंग Learn C++ function overloading - which signatures can overload, how the compiler ranks candidates, why calls become ambiguous, and when to use templates instead.
  6. 46 inline फ़ंक्शन What inline really means in modern C++ - the one-definition rule, defining functions and variables in headers, implicit inline, C++17 inline variables, and optimizer inlining.
  7. 47 रिकर्शन Learn recursion in C++ - base and recursive cases, how the call stack works, factorial, Fibonacci and fast power, stack overflow, tail calls, loops vs recursion and memoization.
  8. 48 Scope, Lifetime और Storage Duration Understand C++ scope and lifetime - block and global scope, shadowing, automatic, static, dynamic and thread storage duration, static local variables, and global variable pitfalls.
  9. 49 नेमस्पेस (Namespaces) Learn C++ namespaces - defining and reopening them, nested a::b namespaces, aliases, using declarations vs directives, anonymous namespaces, ADL, and the rules for std.
  10. 50 हेडर फ़ाइलें और कई सोर्स फ़ाइलें Split C++ programs into .h and .cpp files - what goes in a header, include guards and #pragma once, the one-definition rule, how the linker joins files, and modules.
  11. 51 प्रीप्रोसेसर और मैक्रो Learn the C++ preprocessor - #define macros and their pitfalls, # and ##, conditional compilation, predefined macros, #warning, __has_include and feature-test macros.
  12. 52 फ़ंक्शन पॉइंटर और std::function Learn C++ function pointers - declaration syntax, callbacks, arrays of functions, std::function, and how they compare with templates and lambdas.
  13. 53 कॉलबैक: फ़ंक्शन पॉइंटर, std::function और लैम्ब्डा Design callbacks in C++: compare function pointers, templates and std::function, pass state safely, unsubscribe with RAII handles, handle exceptions and use move_only_function.

Pointers, References and Memory

  1. 54 रेफ़रेंस (References) Learn C++ references - lvalue references as aliases, references as parameters and return values, const references binding temporaries, and dangling pitfalls.
  2. 55 पॉइंटर Learn C++ pointers from scratch - addresses, the & and * operators, nullptr, pointers to structs with ->, pointers to pointers, and why null dereference is UB.
  3. 56 पॉइंटर और ऐरे Learn C++ pointer arithmetic - how arrays decay to pointers, p + n and p[n], pointer differences, one-past-the-end, comparison rules and iterating with pointers.
  4. 57 पॉइंटर और रेफ़रेंस के साथ const Learn C++ const with pointers and references - pointer to const vs const pointer, reading declarations right to left, const_cast dangers and const correctness.
  5. 58 डायनामिक मेमोरी: new और delete Learn C++ dynamic memory - heap allocation with new and delete, new[] and delete[], memory leaks, double delete, dangling pointers and why modern code avoids raw new.
  6. 59 स्मार्ट पॉइंटर: std::unique_ptr Learn C++ std::unique_ptr - exclusive ownership, std::make_unique, moving ownership, passing to functions, custom deleters, arrays and polymorphic objects.
  7. 60 Smart Pointer: shared_ptr और weak_ptr Learn C++ std::shared_ptr and std::weak_ptr - shared ownership, make_shared, reference counts, breaking cycles with weak_ptr, costs, and choosing a smart pointer.
  8. 61 Memory Leaks: कारण, पहचान और बचाव Learn how memory leaks happen in C++ - early returns, exceptions, lost pointers, owning containers, constructors that throw - and how RAII, smart pointers and LeakSanitizer fix them.
  9. 62 Memory Layout: Stack, Heap और Objects See how C++ lays out memory - stack, heap and static storage, object size, alignment and padding, sizeof of classes, alignas, and why contiguous data is fast.
  10. 63 अनडिफ़ाइंड बिहेवियर और मेमोरी सेफ़्टी Understand undefined behavior in C++ - what it is, why optimizers exploit it, the common causes like out-of-bounds and use-after-free, and how sanitizers catch them.

Object-Oriented Programming

  1. 64 C++ में Object-Oriented Programming An overview of object-oriented programming in C++ - classes and objects, encapsulation, inheritance, polymorphism and abstraction, and how OOP fits C++'s multi-paradigm style.
  2. 65 क्लास और ऑब्जेक्ट Learn to define C++ classes - member variables and functions, creating objects, the dot and arrow operators, struct vs class, and defining member functions outside the class.
  3. 66 कंस्ट्रक्टर और मेंबर इनिशियलाइज़र लिस्ट Master C++ constructors - default and parameterized constructors, member initializer lists and their order, default member initializers, delegating constructors, explicit and = default.
  4. 67 डिस्ट्रक्टर और RAII Learn C++ destructors and RAII - when objects are destroyed, destruction order, wrapping files and locks in classes, cleanup during exceptions, and why RAII beats finally.
  5. 68 एक्सेस स्पेसिफ़ायर और एनकैप्सुलेशन Learn C++ access specifiers - public, private and protected, getters and setters done right, class invariants, leaking internals by reference, and designing clean class interfaces.
  6. 69 this पॉइंटर Understand the C++ this pointer - how member functions find their object, this-> for shadowed names, returning *this for chaining, capturing this in lambdas, and C++23 deducing this.
  7. 70 const मेंबर फ़ंक्शन और mutable Learn C++ const member functions - const objects, why getters must be const, const overloading of operator[], mutable caches, and const-correctness pitfalls.
  8. 71 Static मेंबर Learn C++ static members - class-wide data, inline static and constexpr static members, static member functions, instance counters, and why singletons cause trouble.
  9. 72 फ़्रेंड फ़ंक्शन और क्लास Learn C++ friend functions and friend classes - granting private access, friends for operators, hidden friends, tightly coupled classes, and when friendship is a design smell.
  10. 73 Operator Overloading Learn C++ operator overloading - arithmetic and compound assignment, defaulted == and <=>, stream << and >>, subscript and call operators, member vs free functions, and good taste.
  11. 74 कॉपी कंस्ट्रक्टर और कॉपी असाइनमेंट Learn C++ copy semantics - when objects are copied, memberwise copies, shallow vs deep copy with a resource-owning class, self-assignment, copy elision and copy-and-swap.
  12. 75 मूव सिमेंटिक्स (Move Semantics) Learn C++ move semantics - lvalues and rvalues, rvalue references, std::move, move constructors and assignment, noexcept moves in std::vector, and moved-from objects.
  13. 76 Rule of Zero, Three और Five Learn the C++ rules of zero, three and five - the six special member functions, when the compiler generates them, = default and = delete, and why the rule of zero wins.
  14. 77 इनहेरिटेंस (Inheritance) Learn C++ inheritance - base and derived classes, constructor and destructor order, protected members, inheriting constructors, name hiding vs overriding, and final.
  15. 78 इनहेरिटेंस में एक्सेस, मल्टीपल और वर्चुअल इनहेरिटेंस Learn C++ public, protected and private inheritance, multiple inheritance, the diamond problem, virtual inheritance and mixins, with runnable examples.
  16. 79 वर्चुअल फ़ंक्शन और पॉलीमॉर्फ़िज़्म Learn C++ virtual functions - dynamic dispatch, override and final, how vtables work, why base classes need virtual destructors, and how object slicing happens.
  17. 80 एब्स्ट्रैक्ट क्लास और इंटरफ़ेस Learn C++ abstract classes - pure virtual functions, interfaces as abstract classes, programming to an interface, and factory functions that return unique_ptr<Base>.
  18. 81 RTTI, dynamic_cast और typeid Learn C++ RTTI - dynamic_cast with pointers and references, cross casts, typeid and type_info, the four C++ casts compared, and when type checks are a design smell.
  19. 82 Structs, Aggregates और Unions Learn C++ structs and aggregates - aggregate and designated initialization (C++20), structured bindings, unions and why std::variant is safer, and bit-fields.
  20. 83 एन्यूमरेशन: enum और enum class Learn C++ enumerations - unscoped enum vs scoped enum class, underlying types, std::to_underlying, enums in switch, converting to strings, and type-safe enum flags.
  21. 84 नेस्टेड और लोकल क्लास Learn C++ nested classes and their access rules, private helper types like list nodes, the pimpl idiom for stable headers, and local classes defined inside functions.
  22. 85 PIMPL और API/ABI स्थिरता Learn the PIMPL idiom in C++ to hide private members, cut compile times and keep a library's binary interface stable. Covers unique_ptr pimpl, copying, ABI rules and C handles.

Templates and Generic Programming

  1. 86 फ़ंक्शन टेम्पलेट Learn C++ function templates - template syntax, template argument deduction, explicit template arguments, abbreviated templates with auto (C++20), and why templates live in headers.
  2. 87 क्लास टेम्पलेट Learn C++ class templates - build a generic Stack<T>, define members outside the class, use class template argument deduction and non-type parameters.
  3. 88 टेम्पलेट स्पेशलाइज़ेशन Learn C++ template specialization - full and partial specialization of class templates, specializing function templates, and when overloading is the better choice.
  4. 89 कॉन्सेप्ट और कंस्ट्रेंट Learn C++20 concepts - requires clauses, standard concepts like std::integral and std::ranges::range, writing your own concepts, and much clearer template errors.
  5. 90 वैरिएडिक टेम्पलेट और फ़ोल्ड एक्सप्रेशन (Variadic Templates and Fold Expressions) Learn C++ variadic templates - parameter packs, pack expansion, fold expressions, a type-safe print and sum, forwarding references and perfect forwarding with std::forward.
  6. 91 कंपाइल-टाइम प्रोग्रामिंग: constexpr और consteval Learn C++ compile-time programming - constexpr functions, if constexpr, consteval and if consteval, static_assert, and building lookup tables while your code compiles.
  7. 92 Type Traits और मेटाप्रोग्रामिंग Learn C++ type traits and metaprogramming - is_integral, remove_reference, conditional, writing your own traits, SFINAE with enable_if versus concepts, and std::declval.
  8. 93 SFINAE और Overload Resolution Learn how C++ picks between overloads and templates, what substitution failure is not an error means, and how enable_if, void_t, decltype and priority tags select code at compile time.

The Standard Library (STL)

  1. 94 Standard Template Library Get the big picture of the C++ Standard Template Library - containers, iterators and algorithms, how they fit together, choosing the right container, and Big-O guarantees.
  2. 95 इटरेटर (Iterators) Learn C++ iterators - begin and end, iterator categories, const and reverse iterators, insert iterators, iterator invalidation rules, and std::advance, next and distance.
  3. 96 std::vector की गहराई में How std::vector really works - geometric growth and amortized cost, reserve and shrink_to_fit, emplace_back vs push_back, erase-remove, std::erase and vector<bool>.
  4. 97 std::deque, std::list और std::forward_list Learn C++ std::deque, std::list and std::forward_list - how they store elements, O(1) operations, splice, iterator stability and the real cost of node-based containers.
  5. 98 कंटेनर एडैप्टर: stack, queue और priority_queue Learn C++ std::stack, std::queue and std::priority_queue - LIFO and FIFO operations, min-heaps with std::greater, custom comparators and top-k problems.
  6. 99 std::map और std::multimap Learn C++ std::map and std::multimap - sorted key-value storage, insert vs operator[], try_emplace, find and contains, lower_bound range queries and custom ordering.
  7. 100 std::unordered_map Learn C++ std::unordered_map - how hash tables give average O(1) lookups, buckets and load factor, reserve and rehash, custom hash functions and counting words.
  8. 101 std::set और std::unordered_set Learn C++ std::set, std::multiset and std::unordered_set - unique elements, ordered vs hashed sets, custom ordering, removing duplicates and set operations with algorithms.
  9. 102 std::pair और std::tuple Learn C++ std::pair and std::tuple - creating them, structured bindings, std::get, std::tie and std::ignore, std::apply, comparisons, and when a named struct is clearer.
  10. 103 std::optional, std::variant, std::any और std::expected Learn the C++ vocabulary types - std::optional with value_or and and_then, std::variant with std::visit, std::any, and std::expected for error handling in C++23.
  11. 104 std::bitset Learn C++ std::bitset - fixed-size bit sets, set, reset, flip and test, count, any, all and none, bitwise operators, to_string and to_ulong, plus real use cases.
  12. 105 लैम्ब्डा एक्सप्रेशन Learn C++ lambdas - syntax, capturing by value, by reference, this and init captures, mutable, generic and template lambdas, lambdas with algorithms, and recursion.
  13. 106 फ़ंक्शन ऑब्जेक्ट और std::function Learn C++ function objects - writing functors, std::less and std::greater, transparent comparators, std::function vs templates, std::invoke, bind_front and not_fn.
  14. 107 एल्गोरिदम: खोज, सॉर्टिंग और गिनती Learn C++ STL algorithms for sorting and searching - sort, stable_sort, partial_sort, nth_element, find_if, binary_search, lower_bound, count_if, min_element, any_of.
  15. 108 एल्गोरिदम: ट्रांसफ़ॉर्म और संशोधन Learn C++ modifying algorithms - copy and copy_if, transform, fill and generate, replace, the remove-erase idiom, unique, reverse, rotate, shuffle and sample.
  16. 109 न्यूमेरिक एल्गोरिदम (Numeric Algorithms) Learn the C++ numeric algorithms - accumulate and its init-type trap, fold_left, reduce, inner_product, transform_reduce, partial_sum, scans, iota, gcd and lcm.
  17. 110 रेंज और व्यू Learn C++20/23 ranges - range algorithms with projections, lazy views like filter, transform, take, split, zip, enumerate and chunk, pipelines with |, and std::ranges::to.
  18. 111 multiset और multimap परिवार Learn C++ containers that allow duplicate keys - multimap, multiset, unordered_multimap and unordered_multiset - with equal_range, safe erasing, grouping and when to choose them.

Errors and Debugging

  1. 112 एक्सेप्शन (Exceptions) Learn C++ exceptions - throw, try and catch, catching by const reference, the standard exception hierarchy in stdexcept, stack unwinding with destructors, and rethrowing.
  2. 113 कस्टम एक्सेप्शन क्लास Learn to write custom exception classes in C++ - deriving from std::runtime_error, adding data, overriding what(), building hierarchies and nesting exceptions.
  3. 114 Exception Safety और noexcept Learn C++ exception safety - the basic, strong and nothrow guarantees, RAII as the foundation, copy-and-swap, noexcept and move_if_noexcept, and why destructors must not throw.
  4. 115 एक्सेप्शन के बिना एरर हैंडलिंग Handle errors in C++ without exceptions - return codes, [[nodiscard]], std::optional, std::expected with and_then and transform, std::error_code, and how to choose.
  5. 116 सिग्नल हैंडलिंग Handle signals in C++ with <csignal> - std::signal and std::raise, what a handler may safely do, sig_atomic_t and atomic flags, graceful shutdown and threads.
  6. 117 असर्शन और डीबगिंग Find C++ bugs fast - assert and NDEBUG, static_assert, debug logging with std::source_location, library assertions, sanitizers, gdb basics and reading template errors.
  7. 118 Sanitizer और Valgrind Find memory errors, undefined behavior, data races and leaks in C++ with AddressSanitizer, UBSan, ThreadSanitizer and Valgrind - flags, sample reports and how to read them.
  8. 119 GoogleTest और Catch2 से यूनिट टेस्टिंग Learn C++ unit testing - test cases, assertions, fixtures, parameterized tests and matchers in GoogleTest and Catch2, plus CMake setup and a tiny runnable test harness of your own.
  9. 120 clang-tidy और Static Analysis Catch C++ bugs before running the program. Turn on compiler warnings, configure clang-tidy checks, read its diagnostics, fix typical findings and run analysis in CI.
  10. 121 सुरक्षित C++ कोडिंग Write safer C++ by avoiding dangling references, check bounds with at() and span, validate integer sizes, enable hardened library modes and compiler hardening flags.

Input/Output and Files

  1. 122 I/O स्ट्रीम विस्तार से Master C++ I/O streams - the iostream class hierarchy, cin, cout, cerr and clog, fail/eof/bad state flags, recovering from bad input, manipulators and fast I/O.
  2. 123 टेक्स्ट फ़ाइलें पढ़ना और लिखना Read and write text files in C++ with ifstream, ofstream and fstream - open modes, checking for errors, reading line by line or word by word, and RAII closing.
  3. 124 बाइनरी फ़ाइलें Work with binary files in C++ - write and read raw bytes, fixed-size records, seekg/tellg random access, padding pitfalls, endianness and std::byteswap (C++23).
  4. 125 स्ट्रिंग स्ट्रीम्स Use C++ string streams - parse text with istringstream, build strings with ostringstream, split strings with getline, reuse streams safely, and when std::format is better.
  5. 126 फ़ाइलसिस्टम लाइब्रेरी Learn C++ std::filesystem - build and split paths, check files, create directories, list folders recursively, copy, rename and remove files, and handle errors safely.

Utilities

  1. 127 chrono के साथ तारीख़ें, समय और अवधि Learn C++ std::chrono - durations and literals like 500ms, steady and system clocks, timing code, calendar dates with year_month_day, time zones, formatting and parsing.
  2. 128 रैंडम नंबर Learn to generate random numbers in modern C++ with <random> - why rand() is bad, mt19937 engines, seeding, uniform and normal distributions, weighted picks and std::shuffle.
  3. 129 रेगुलर एक्सप्रेशन (Regular Expressions) Learn C++ regular expressions with std::regex - regex_match vs regex_search, capture groups, iterating over matches, regex_replace, splitting text, and performance traps.
  4. 130 न्यूमेरिक लिमिट, कॉम्प्लेक्स नंबर और बिट मैनिपुलेशन Query type limits with std::numeric_limits, compute with std::complex, use the C++20 <bit> functions popcount, bit_width and rotl, and reinterpret bits safely with std::bit_cast.
  5. 131 नेटवर्क प्रोग्रामिंग की बुनियादी बातें Learn C++ network programming with POSIX sockets - a RAII socket wrapper, a TCP echo server and client on loopback, reliable send and receive loops, and message framing.

Concurrency

  1. 132 थ्रेड्स Learn C++ threads - start work with std::thread, join and detach, pass arguments safely, split work across cores, and stop std::jthread workers cleanly with stop tokens.
  2. 133 म्यूटेक्स और लॉक (Mutexes and Locks) Learn to protect shared data in C++ - data races, std::mutex, lock_guard, unique_lock, scoped_lock for deadlock-free locking, shared_mutex for readers, and call_once.
  3. 134 रेस कंडीशन और डेटा रेस Understand the difference between data races and race conditions in C++, see check-then-act, split-invariant and lazy-init bugs reproduced on demand, and fix them with locks, CAS and call_once.
  4. 135 कंडीशन वेरिएबल Learn std::condition_variable in C++ - wait with a predicate, notify_one and notify_all, spurious and lost wakeups, a producer-consumer queue, timeouts and stop tokens.
  5. 136 सेमाफ़ोर, डेडलॉक और क्लासिक कॉन्करेंसी समस्याएँ Learn C++20 counting and binary semaphores, how they differ from mutexes, the four deadlock conditions, the dining philosophers, a bounded buffer and false sharing.
  6. 137 ऐटॉमिक और मेमोरी मॉडल Learn C++ atomics - std::atomic, fetch_add, compare_exchange loops, memory orders like acquire and release, an atomic_flag spinlock, and when a mutex is the better choice.
  7. 138 std::async, फ़्यूचर और प्रॉमिस Learn C++ task-based concurrency - std::async and launch policies, std::future and shared_future, promise, packaged_task, timeouts, and passing exceptions between threads.
  8. 139 कोरुटीन Learn C++20 coroutines - lazy sequences with co_yield and std::generator (C++23), how co_await and co_return work, writing a minimal generator, and lifetime pitfalls.
  9. 140 Parallel एल्गोरिदम और Execution Policy Speed up STL algorithms with C++17 execution policies - seq, par, par_unseq and unseq, parallel reduce and transform_reduce, and the rules for safe callbacks.

Modern C++ and Beyond

  1. 141 स्टैंडर्ड के अनुसार Modern C++ फ़ीचर A tour of what each C++ standard added, from C++11 lambdas and smart pointers to C++23 std::print and std::expected, with runnable examples and a C++26 preview.
  2. 142 User-Defined Literals Learn C++ user-defined literals - write operator"" suffixes for units and types, raw and template forms, naming rules, and use std::literals such as s, sv, ms and i.
  3. 143 C++20 मॉड्यूल (Modules) Learn C++20 modules - why headers are slow and leaky, export module and import, implementation units, partitions, import std in C++23, and how to build modules today.
  4. 144 बिल्ड सिस्टम: Make और CMake Learn how C++ projects are built - incremental builds, writing a Makefile, modern CMake with targets and build types, and managing libraries with vcpkg and Conan.
  5. 145 कंपाइलर, Flags और Optimization Learn the C++ compiler flags that matter - warning sets, -O levels, debug info, sanitizers, LTO and hardening - and see how the optimizer transforms code, with live demos.
  6. 146 तेज़ C++ लिखना Learn to write fast C++ - measure with chrono, cache-friendly data layouts, vector versus list, avoiding copies and allocations, reserve, move, small string optimization and inlining.
  7. 147 C++ में डिज़ाइन पैटर्न Learn the design patterns that matter in modern C++ - RAII, factory, builder, strategy, observer, CRTP, PIMPL and singleton - with runnable examples and their trade-offs.
  8. 148 बेस्ट प्रैक्टिस और आम ग़लतियाँ The habits that keep modern C++ correct and readable - clear ownership, const correctness, no raw new, initialized variables, algorithms, warnings - and the bugs to avoid.
  9. 149 C और C++: अंतर और इंटरऑपरेबिलिटी How C and C++ differ - what C++ added, valid C that C++ rejects, printf vs std::print, malloc vs new - and how to call C libraries with extern "C" safely.
  10. 150 एलोकेटर और std::pmr Learn C++ allocators and std::pmr - write a minimal custom allocator, use monotonic buffer and pool resources, pmr containers, allocator propagation and when it pays off.
  11. 151 std::bit_cast, mdspan और नई यूटिलिटीज़ A tour of useful C++20 and C++23 library additions - std::bit_cast, bit utilities, byteswap, to_underlying, flat_map, move_only_function and mdspan for multidimensional views.
  12. 152 कैश-फ़्रेंडली कोड Learn why memory layout often matters more than instructions. Understand CPU caches and cache lines, spatial and temporal locality, array of structs versus struct of arrays, and hot/cold splitting.

Projects

  1. 153 प्रोजेक्ट: Grade Book Build a C++ grade book in four stages. Parse names and scores from input, reject bad lines with std::expected, compute statistics and print a neat report.
  2. 154 प्रोजेक्ट: Bank Account System Build a C++ bank account system in four stages - an encapsulated Account class, custom exceptions, a transaction history, polymorphic accounts and a command processor.
  3. 155 प्रोजेक्ट: Library Catalog Build a C++ library catalog in four stages - store books in a std::map, parse commands from input, search and sort with ranges, and manage loans with clear rules.
  4. 156 प्रोजेक्ट: Text Statistics Build a C++ text analyzer in four stages - count words, lines and sentences, find the most frequent and longest words with unordered_map, and print a sorted report.
  5. 157 प्रोजेक्ट: Tic-Tac-Toe Build tic-tac-toe in C++ in four stages - a std::array board, enum class marks, validated moves from input, win detection and an unbeatable minimax computer player.
  6. 158 प्रोजेक्ट: एक छोटी Matrix लाइब्रेरी Build a C++ Matrix class template in four stages - vector storage, operator overloading, size-checking exceptions, assert-based tests, a concept and a std::formatter.

Data Structures and Algorithms

  1. 159 C++ में डेटा स्ट्रक्चर Build classic data structures in modern C++ - a growable array, a stack, a ring-buffer queue, a linked list with unique_ptr nodes and a binary search tree.
  2. 160 सर्चिंग और सॉर्टिंग एल्गोरिदम Implement linear and binary search plus bubble, selection, insertion, merge, quick and heap sort in C++, with traces, Big-O analysis and timings against std::sort.
  3. 161 ग्राफ़, रिकर्शन और बैकट्रैकिंग Represent graphs in C++ with adjacency lists, explore them with BFS and DFS, find shortest paths with Dijkstra, order tasks topologically and solve N-Queens by backtracking.

Practice and Review

  1. 162 C++ चीट शीट A one-page modern C++ cheat sheet with types, strings, format specs, control flow, functions, lambdas, smart pointers, classes, templates, STL containers and ranges.
  2. 163 C++ प्रोग्राम: 40 क्लासिक उदाहरण 40 classic C++ programs with output: prime check, factorial, Fibonacci, palindromes, GCD and LCM, Armstrong numbers, base conversion, sorting, matrices and more.
  3. 164 C++ प्रोग्राम: पैटर्न प्रिंटिंग C++ pattern printing programs with output: half and inverted pyramids, hollow shapes, diamond, hollow diamond, Floyd's triangle and number and letter patterns.
  4. 165 C++ प्रोग्राम: मैट्रिक्स समस्याएँ C++ matrix programs with output: trace, normal, rotate 90 degrees, spiral order, boundary sum, symmetry checks, row swap, determinant and 2D prefix sums.
  5. 166 C++ प्रोग्राम: ऐरे और सर्चिंग पहेलियाँ C++ array puzzles with output: common elements, prefix sums, Dutch flag sort, wave sort, rotated array search, sorting 2D rows and next greater element.
  6. 167 C++ प्रोग्राम: स्ट्रिंग के काम C++ string programs with output: add binary strings, strip leading zeros, split a string, pangram check, reverse with a stack and word initials.
  7. 168 C++ प्रोग्राम: OOP और STL नुस्ख़े C++ class and STL recipes with output: singleton, interface, complex class with ++ and --, vector of pairs to map, merging maps, multiset, permutations.
  8. 169 C++ प्रोग्राम: फ़ाइलें और तारीख़ें C++ file and date programs with output: temp file, rename, copy, append, list a folder, print a month calendar and convert local time to UTC.
  9. 170 C++ अभ्यास प्रश्न 29 graded C++ exercises with solutions on loops, functions, strings, vectors, maps, classes, templates, the STL and threads. Write and run C++ in your browser.
  10. 171 C++ इंटरव्यू प्रश्न 50 common C++ interview questions with clear answers, from pointers, references and const to virtual functions, smart pointers, move semantics, the STL and threads.