• home


  • C++ Language: Learn this versatile and powerful programming language. Includes detailed explanations of pointers, functions, classes and templates, among others...
  • Reference

    Description of the most important classes, functions and objects of the Standard Language Library, with descriptive fully-functional short programs as examples.
    Browse the C++ Reference


    User-contributed articles, organized into different categories.
    You can contribute your own articles!
    Browse Articles

    Latest forum activity:

    by zapshe
    Typing Speed Test   [Lounge]
    Do we want to partake in competition again? ------ Reference: https://cplusplus.com/forum/lounge/279014/ I found that the code we used last time wasn't workin...
    [6 replies] Last: A speed typing "challenge" is rather a losing proposition for me, incr... (by George P)
    by helios
    Specialization vs. Diversification   [Lounge]
    Suppose that you already have some competency (which if you're here, probably doesn't stress your imagination) and that there's some completely unrelated discip...
    [5 replies] Last: I still think it is a false dichotomy. Humans live upwards around 80 ... (by Duthomhas)
    by Ch1156
    Best way to modify a variable in a class (1,2,3,4)   [Beginners]
    So whats the best way to modify a variable in a class? Below I have a version that does so through a pointer, but is it better to just make a function that modi...
    [62 replies] Last: I just wanted you to think about it. Breaking things into smaller bi... (by jonnin)
    Finding minimum element of a tuple on the basis of first element   [Beginners]
    Hello everyone, I do not know, if it is possible to find the minimum first element in a tuple without using sort function. I have a tuple like this : data=[...
    [3 replies] Last: #include <iostream> #include <tuple> // https://en.cppreference.com/w... (by George P)
    Convert binary to base 58   [Beginners]
    I want to convert a long binary number, 256 bits, into a base 58 char array using c code. I cannot find a simple explanation. The Bing tool insists on convert...
    [9 replies] Last: It seems they simply use a different mapping of the characters 😏 Jus... (by kigar64551)
    by zzzhhh
    Which ctor of std::unique_ptr is used, when there is a user-defined deleter which is a function?   [Beginners]
    Following is excerpted from section 12.1.5 of text "C++ Primer", which contains text and code constructing `std::unique_ptr` with a user-defined deleter which i...
    [1 reply] : The code calls constructor 3 or 4. When the cppreference page writes ... (by Peter87)
    txt file to vector giving wrong values   [Beginners]
    I'm loading a txt file into a vector using the code I've written below. It works great except for one BIG issue i'm having. First I'll give a very small exampl...
    [11 replies] Last: There's a good (and free) set of C++ tutorials and lessons available o... (by George P)
    by zzzhhh
    Why can't assign an overloaded function to std::function?   [Beginners]
    int add(int i, int j) { return i + j; } std::string add(const std::string& s1, const std::string& s2) { return s1 + s2; } ... std::function<int(int, int)>...
    [1 reply] : There is a constructor template and a class template in play here, and... (by mbozzi)
    type const char * not compatible with LPCWSTR   [Windows Programming]
    Hello everyone, Trying Win API 32 with creating sample Window, handle message using ressources in CPP compiler returns the message const char * type argument no...
    [15 replies] Last: Since I have updated .json in v.s. code #include <sal.h>[/code] is no... (by TrouthieCPP)
    by stav
    which one of these bytecode instruction designs is better?   [General C++ Programming]
    I've been going down a bit of a rabbit hole trying to figure out the most optimal way to design a bytecode instruction class. To be clear an instruction is som...
    [7 replies] Last: I don't think either of these approaches of good. To see why, consider... (by dhayden)