[go: nahoru, domu]

  • 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
    It is known that we can't initialize rvalue reference with lvalue, but why can function name?   [Beginners]
     
    It is said that we can't initialize an rvalue reference with an lvalue. For example: int i=0; int && irr = std::move(i); int && irr2 = irr; [/code]In the above...
    2024-07-02T03:35:43.000Z
    [4 replies] Last: Let me confirm your answer first. The link you gave me is "No, because... (by zzzhhh)
    c++ array negative numbers   [General C++ Programming]
     
    I am trying to solve this problem, but got wrong output. Given an array of integers, write a function to move all the negative numbers to the left end of the a...
    2024-07-02T01:51:31.000Z
    [3 replies] Last: Try std::remove_if with reverse iterators? (by mbozzi)
    by zapshe
    I work for Google... (1,2)   [Lounge]
     
    I didn't know if I was training OpenAI's GPT models or not. Turns out I was in fact training Google's Gemini model. I'm not sure what the relationship betwee...
    2024-07-02T01:04:17.000Z
    [24 replies] Last: Even so, in many cases would be faster than writing the code yourself... (by helios)
    c++ indice 2 numbers   [General C++ Programming]
     
    I solved the below problem. Can anyone tell me the best way here? Given a list of integers and a target sum, write a function to find the indices of the tw...
    2024-07-01T21:29:17.000Z
    [1 reply] : the best way would be to load a hash table of the data (this hash tabl... (by jonnin)
    What is the difference between declaring a variable auto and declaring it auto&&?   [General C++ Programming]
     
    Hi, I have two variables for a general function f(): auto value = f(); auto&& other = f(); [/code] what is the difference between them?
    2024-07-01T14:25:26.000Z
    [9 replies] Last: Why auto&& and not auto& ?[/quote] I had to look this one up. && i... (by jonnin)
    by Cplusc
    MPI_Sendrecv   [General C++ Programming]
     
    I am encountering confusion with the following block of my code, specifically regarding the MPI_Sendrecv function. My question concerns the source and destinati...
    2024-06-29T20:29:16.000Z
    [no replies]
    by zzzhhh
    Why is const gone in the return type?   [Beginners]
     
    template <typename T> const T&& Test(T&& t) { return t; } ...... int i = 0; int&& irr = std::move(i); decltype(Test(irr)) t = i; [/code] Since there is a `c...
    2024-06-29T15:12:16.000Z
    [5 replies] Last: @Peter87: Thank you for referring me to the relevant Standard. I think... (by zzzhhh)
    Lions and Tigers and Pointers, oh my! (1,2)   [Lounge]
     
    I’ve been spending time at SO again lately (dunno why) and I am again impressed by how confused people get by the idea of pointers. It really doesn’t seem to...
    2024-06-27T06:55:49.000Z
    [23 replies] Last: Alignment is (or at least was) relevant for vectorization. While compi... (by keskiverto)
    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...
    2024-06-26T19:31:32.000Z
    [16 replies] Last: I think you guys covered it... it depends on 2 main things, your actu... (by jonnin)
    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...
    2024-06-24T23:55:10.000Z
    [10 replies] Last: I get the same result on those 2 sites (dcode only accepts decimal inp... (by DizzyDon)