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

Search:

Type: Posts; User: 2kaud

Page 1 of 80 1 2 3 4

Search: Search took 0.06 seconds.

  1. Replies
    1
    Views
    152

    Re: Which is better method to start learn C++?

    The best on-line free resource to learn C++ is https://www.learncpp.com/

    For a book, IMO the best to learn from is Ivor Horton's Beginning C++: From Novice To Professional...
  2. Replies
    10
    Views
    611

    Re: help with hobby programming in C++

    Sorry my bad - I blame not enough coffee! When I was going through the original code I misread one line and used 8 instead of v.size() - 1.

    I've also changed in main re detecting no move possible...
  3. Replies
    10
    Views
    611

    Re: help with hobby programming in C++

    As an example of using std::unordered_set consider:



    #include <iostream>
    #include <unordered_set>

    struct Pos {
    int i {};
    int j {};
  4. Replies
    10
    Views
    611

    Re: help with hobby programming in C++

    You need to maintain a container of already visited locations. I'd suggest a std::unordered_set

    https://cplusplus.com/reference/unordered_set/unordered_set/

    insert only works if the value to be...
  5. Replies
    10
    Views
    611

    Re: help with hobby programming in C++

    Then you need to use the debugger to trace through the code to see where is the issue.

    When I ran the code, I was getting -ve values for moved to in disp().



    Moved to (11,1)

    Total moves :...
  6. Replies
    10
    Views
    611

    Re: help with hobby programming in C++

    There are various issues with variables being defined at global or function level and then at local scope level.

    As a start, this revised c++ code compiles cleanly. If it now doesn't work as...
  7. Re: Implicit type conversion and time measurement.

    The original question was



    When signed/unsigned operations are mixed, the signed will always be 'promoted' to unsigned. Then the operation is performed. This automatic promotion is often...
  8. Re: Implicit type conversion and time measurement.

    [also asked here https://cplusplus.com/forum/windows/283922/ ]
  9. Thread: Functor

    by 2kaud
    Replies
    17
    Views
    786

    Re: Functor

    Just trying to help... Some aspects of C++ can be confusing/bewildering (add your own adjective!).
  10. Replies
    15
    Views
    949

    Re: needs to convert C++ code to JAVA

    ... but that would require the OP to actually do some work as opposed to being spoon-fed!
  11. Thread: Functor

    by 2kaud
    Replies
    17
    Views
    786

    Re: Functor

    Several of the std::algorithm functions work in the same way. eg sort()
  12. Replies
    2
    Views
    210

    Re: Running an application on multiple CPUs

    It depends upon how the program has been coded. If it is coded as a multi-threaded program, then the number of threads used is dependent upon how the program uses threads. It might be coded to just...
  13. Thread: Functor

    by 2kaud
    Replies
    17
    Views
    786

    Re: Functor

    Whatever the default constructor does - if the class has no member variables then nothing.



    std::max (along with most other algorithms) is template based. See...
  14. Replies
    15
    Views
    949

    Re: needs to convert C++ code to JAVA

    It could be by someone who knows both C++ and Java. However I doubt that anyone looking at this thread with the requisite skills will actually do this 'ex gratia'. This forum isn't for getting work...
  15. Thread: Functor

    by 2kaud
    Replies
    17
    Views
    786

    Re: Functor

    Yes. It's a class name. What happens 'under the hood' is that the supplied class is instantiated using the default constructor and then from that object the operator() function is called with the...
  16. Thread: Functor

    by 2kaud
    Replies
    17
    Views
    786

    Re: Functor

    which is operator
  17. Thread: Functor

    by 2kaud
    Replies
    17
    Views
    786

    Re: Functor

    That is a ComplexComparer constructor that takes 2 args. If ComplexComparer had such a constructor it would be called first with the given constructor args, Then the operator() would be called with...
  18. Thread: Functor

    by 2kaud
    Replies
    17
    Views
    786

    Re: Functor

    Through the operator() which takes 2 args.
  19. Thread: Functor

    by 2kaud
    Replies
    17
    Views
    786

    Re: Functor

    std::max calls operator() [the same as other functions that call functors]. The passed args to operator() are a and b from std::max()
  20. Replies
    19
    Views
    1,145

    Re: Strange red blocks in Editor window

    Have you tried installing the Intellisense Extender as an extension? It provides additional info re potential code issues.
  21. Replies
    2,370
    Views
    1,066,064

    Re: The Boring Thread

    Well either it's a really boring party or this thread isn't meeting it's objectives........
  22. Replies
    3
    Views
    549

    Re: Palindrome Problem in C++

    #include <iostream>
    #include <iomanip>

    bool checkPalindrome(unsigned original) {
    unsigned reverseNum {};

    for (auto tempOriginal {original}; tempOriginal > 0; tempOriginal /= 10)...
  23. Re: What's wrong with my std::ostringstream usage

    We've all made stupid mistakes at least once, twice...
  24. Re: How to get file permissions that are associated with a file?

    Do you mean file permissions or file attributes? These are quite different.
  25. Replies
    1
    Views
    269

    Re: Visual Studio 17.1 vs 17.2 preview

    See https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-preview
Results 1 to 25 of 2000
Page 1 of 80 1 2 3 4





Click Here to Expand Forum to Full Width

Featured