• home

Tutorials

  • 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

    Articles

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

    Latest forum activity:

    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)
    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...
    [3 replies] Last: Oh nice! You're getting better šŸ˜Ž I keep trying to hit around 2900ms ... (by zapshe)
    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)
    by Ch1156
    Best way to modify a variable in a class (1,2,3)   [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...
    [57 replies] Last: Wait so i think i understand, so if im using polymorphism then general... (by Ch1156)
    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)
    build systems and code editors\IDE's you use or suggest on Linux?   [UNIX/Linux Programming]
     
    For the last 2 years I'm using VSCode, since my switch to Linux I continue to use it. But there are many pitfalls with VSCode, primarily VSCode is not good f...
    [8 replies] Last: Spack https://spack.io/ -- "scientific package manager" -- is not an a... (by keskiverto)
    I wrote a strrstr()   [Lounge]
     
    Just because. https://stackoverflow.com/a/78527348/2706707 If I made a major fail Iā€™m sure the nice folks at SO will let me know, so, feel free to roast i...
    [17 replies] Last: If compiled for 32 bit (as opposed to 64 bit above) then the average t... (by seeplus)
    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...
    [7 replies] Last: You can convert binary to BCD using double-dabble (https://en.wikipedi... (by dhayden)