CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: wolle

Page 1 of 29 1 2 3 4

Search: Search took 0.05 seconds; generated 13 minute(s) ago.

  1. Replies
    8
    Views
    10,983

    Re: memset vs ZeroMemory

    Today you can also do this,


    char buffer[100] = {0};
  2. Re: move data from a 2D vector into a 3D vector, three times. the sizes of the 2D vec

    Assuming the OP wants a vector of random-sized matrices filled with random integers, this is my take. The matrix implementation follows the std::mdspan philosophy,



    #include <iostream>...
  3. Re: move data from a 2D vector into a 3D vector, three times. the sizes of the 2D vec

    The 3D vector looks like a 1D vector of random-sized 2D vectors filled with random one-digit integers.

    Another natural C++ representation would be to keep the 1D vector but encapsulate the 2D...
  4. Re: move data from a 2D vector into a 3D vector, three times. the sizes of the 2D vec

    I know. The std::mdspan is a C++ 23 feature. What I mean is that the principle it represents is already available.
  5. Re: move data from a 2D vector into a 3D vector, three times. the sizes of the 2D vec

    Rather than build the two multidimensional vectors, you could use two one-dimensional vectors together with index mapping functions. As of C++ 23, this approach has standard support by std::mdspan,...
  6. Replies
    3
    Views
    1,698

    JavaScript Re: Javascript: Understanding Recursion

    Your reply is cut & pasted from the "What is recursion?" section here,

    https://www.freecodecamp.org/news/understanding-recursion-in-javascript/

    If you are not familiar with the concept of...
  7. Re: When polling in Java, use Thread.sleep or yield.

    Maybe the idea is not to hog the remote connection with frequent lock requests. A compromise would be to send a couple of quick requests and, if unsuccessful, wait a little longer, like



    int...
  8. Replies
    3
    Views
    1,698

    JavaScript Re: Javascript: Understanding Recursion

    A recursive call in isolation does not explain how the recursive function works. That requires, at least, that the termination criterion is also known. Here is my guess as to what the recursive...
  9. Re: use of algorithms in function cause ERROR: no instance of overloaded function

    I have never tried it before, but std::span of C++ 20 seems a nice way of using C-style arrays with the standard library. An advantage is that it works with std::vector and std::array too.
    ...
  10. Replies
    7
    Views
    5,607

    Re: Convert C++ Code to Java

    Oops! Well, converting between languages is a daunting task. Nevertheless, in this case, the converter should have issued a to-do warning (as I see it usually does when it omits something). Unsigned...
  11. Replies
    7
    Views
    5,607

    Re: Convert C++ Code to Java

    I agree. The code the OP posted looks like written by a C++ newbie, which it probably is, considering where it originates (as someone's solution to a textbook exercise). No programming language...
  12. Re: use of algorithms in function cause ERROR: no instance of overloaded function

    Well, as they say on the moon: Switching to std::vector would be one small step for you but one giant leap for the quality of your code. :)
  13. Re: use of algorithms in function cause ERROR: no instance of overloaded function

    In the function case, the array sizes are unknown. I suggest you switch to std::vector (or std::array) rather than using old C-style arrays. It will work and is better C++.
  14. Replies
    7
    Views
    5,607

    Re: Convert C++ Code to Java

    Your assignment seems to come from here as someone's solution to an exercise in Absolute C++ by Savitch.
    ...
  15. Replies
    7
    Views
    2,391

    Re: how pass a class pointer to a object class?

    The immediate problem is that you declare a pointer variable in the constructor but never assign a pointer to it,



    Pixel *pix;


    And even if you did, the pointer will get lost when the...
  16. Replies
    2
    Views
    2,154

    Re: Java equals() selection

    If the null pointer has meaning and represents "nothing" or "empty" or something of that kind, I would use the Yoda condition. Otherwise, the null pointer is an error, and I would check for it...
  17. Re: Does functional programming replace GoF design patterns?

    If you accomplish a certain functionality according to the OO paradigm using OO patterns, you can achieve the same with the FP paradigm using FP patterns. So in this sense, it is true that FP...
  18. Re: Does functional programming replace GoF design patterns?

    You posted the same question here and got many high-rated replies,

    https://stackoverflow.com/questions/327955/does-functional-programming-replace-gof-design-patterns

    But it was 13 years ago, so...
  19. Thread: C++23

    by wolle
    Replies
    2
    Views
    9,025

    Sticky: How C++23 changes the way we write code

    These are links to the CppCon 2022 keynote speech, where Timur Doumler presents what he considers the four most important features of C++ 23, namely: deducing this, std::expected, std::mdspan, and...
  20. Replies
    1
    Views
    1,302

    Re: Inheterence issue

    You inherit the SummaryStrategy class into AverageSummary. It means AverageSummary is_a SummaryStrategy. But to be that, AverageSummary must implement all abstract methods of SummaryStrategy. Does it...
  21. Re: creation of simple tree like structure using stl vector c++, need help : )

    You could start from an implementation of a binary tree. There are plenty available on the internet and in textbooks.

    In the node declaration, replace the left and right child node pointers with a...
  22. Thread: Developers -

    by wolle
    Replies
    3
    Views
    2,465

    Re: Developers -

    The TIOBE index is a renowned indicator of the most popular languages right now,

    https://www.tiobe.com/tiobe-index/

    An advantage of TIOBE over one-off studies is that TIOBE also shows the...
  23. Replies
    5
    Views
    4,339

    Re: Best book to learn Visual C++ from scratch?

    Visual C++ was once a free-standing product but has become part of Microsoft Visual Studio. There is a free community edition available,

    https://visualstudio.microsoft.com/downloads/

    Select...
  24. Replies
    1
    Views
    2,270

    Re: Questions on what to study for the Software Development Program

    What is the nature of your admission? You provide a link to what seems to be an outsourcing company. Have you become a subcontractor to this company and now want to know what you need to study to...
  25. Thread: DWORD size in VS

    by wolle
    Replies
    6
    Views
    1,429

    Re: DWORD size in VS

    Maybe the variable is a DWORD array. In that case, the 5 you see could denote the array size (rather than the DWORD size.)
Results 1 to 25 of 716
Page 1 of 29 1 2 3 4





Click Here to Expand Forum to Full Width

Featured