• 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 Atom1
    Add a managed .net dll to a cpp dll project   [General C++ Programming]
     
    I am trying to create a cpp dll which will utilize the functions of a managed .net dll. How do I create a reference to the .net dll in my cpp project? The .net ...
    [4 replies] Last: I have taken a crack at this using VS2019 and created a C++/CLI projec... (by Atom1)
    by frek
    defaulted member function   [General C++ Programming]
     
    What does =default[/code] mean in: [code]struct S { int i; S(int ii) : i(ii) {} S() = default; };[/code] If you say, it means that the compiler generates [i...
    [6 replies] Last: I didn't know the story is that massive that needs a book to tell it a... (by frek)
    Long-running computation "hangs" on MacOS (Mac mini M2) (1,2)   [Lounge]
     
    So, I have a long-running computation that pretty much goes like this: void main(void) { std::deque<std::thread> thread; const size_t threadCount = std::min(...
    [23 replies] Last: Heh, you put "App Nap" to sleep. If only temporarily. :Þ Mac OS show... (by George P)
    Correct order of FOR loops, given order of data in external files   [General C++ Programming]
     
    The dimensioned variable HOMEPAT is a stock or inventory variable in a system dynamics simulation model. Initial values of this stock are read into the model at...
    [2 replies] Last: Correction?[/quote] Cut'n'pasting a ton of garbage unformatted code t... (by George P)
    unable to add element to std:map when variable is in a library   [Beginners]
     
    I have this code: https://pastebin.com/5NfEveih compiled with this command: g++ -fPIC -shared -o libjson.so libjson.cp[/code] and this code: https://paste...
    [6 replies] Last: I solve the issue.[/quote] But wouldn't that have been a compiler iss... (by Ganado)
    How to interpret Catch2 output when calculating a BENCHMARK?   [General C++ Programming]
     
    Hi, I have this code: TEST_CASE("Extract_error", "[Parser]") { BENCHMARK("find_include_name") { using namespace std; ParserTest parser{ fa...
    [1 reply] : [quote=JUANDENT]why is the mean value so different from the estimated ... (by Peter87)
    by frek
    Passing pointers to function taking iterators   [General C++ Programming]
     
    Suppose for some reason this code is meant: void accum(std::vector<double>::iterator bg, std::vector<double>::iterator end) { std::cout << std::accumulate(bg,...
    [12 replies] Last: [quote=frek]Why don't you, Peter, as a great coder, go for C++20/23. T... (by Peter87)
    Forum problem   [Lounge]
     
    Sometimes when I try to access this site I get the error: Internal error #xp20 (xp#20). Trying again after a couple of minutes usually succeeds. Anyone...
    [2 replies] Last: I have been getting that error message quite often recently. Usually i... (by Peter87)
    by Gyiove
    event class and dynamic bind paramaters   [General C++ Programming]
     
    I have this c++ class here which can register class function into event class and then call them all with 1 function later. Code: template < typename......
    [3 replies] Last: You're making this more complicated than necessary, IMHO. You don't n... (by dhayden)
    by frek
    C++ multithreading deadlock example   [General C++ Programming]
     
    std::mutex m1, m2; void f_1() { std::unique_lock l1{m1}, l2{m2}; } void f_2() { std::unique_lock l1{m1}, l2{m2}; } [/code]Suppose [i]f_1[/i] starts first an...
    [9 replies] Last: got it, thanks. (by frek)