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.16 seconds.

  1. Re: Using containers list and vector in a program

    Yes - and to watch the contents of the variables. Not only do you get to understand the code, you also get to debug it to make sure it's working as expected and to find out why if it's not. Anyone...
  2. Re: Using containers list and vector in a program

    Nope - I just looked at the code. :)
  3. Re: Using containers list and vector in a program

    Use the debugger to trace through the code to see what is happening and the contents of the variables. Then you'll see exactly.



    if (pos == ln->end())


    pos starts at ln->begin(). ln->end()...
  4. Replies
    8
    Views
    138

    Re: Compiler error 3848

    Just a quick question. You are using the latest version of boost when compiling with VS2019 - not the old version used with VS005?

    I don't know/use boost, but looking again at the code in post #3...
  5. Replies
    8
    Views
    138

    Re: Compiler error 3848

    Re post #3.

    You're not inserting an int to a set of int. The set isn't a set of int - but a set of shared_ptr<list<int>> - which is a very different animal!

    What's with all the shared_ptr??
    ...
  6. Replies
    8
    Views
    138

    Re: Compiler error 3848

    I suspect that .insert() doesn't want a const argument. Try making i ::iterator instead of ::const_iterator. Also, as .begin()/.end() are used rather than .cbegin()/.cend(), then the type should be...
  7. Replies
    2
    Views
    90

    Re: Pointer to a template function ?

    Dont. See https://stackoverflow.com/questions/55687044/can-i-take-the-address-of-a-function-defined-in-standard-library
  8. Replies
    3
    Views
    166

    Re: Confused about /bigobj

    The /bigobj applies to the number of sections in the generated .obj file. So /bigobj would usually be applied to the project properties - not an individual source property. However it shouldn't...
  9. Replies
    3
    Views
    166

    Re: Confused about /bigobj

    Properties/C++/CommandLine. Add it to Additional Options.

    Not all compiler options are in the properties pages - some (another is /J to make char default to unsigned rather than signed) have to be...
  10. Replies
    14
    Views
    364

    Re: My simple vector crashes

    Yep :D - although the std:: version has some additional features over yours. But that is how professional libraries are written - with heavy use of templated code, type_traits etc for support for...
  11. Replies
    14
    Views
    364

    Re: My simple vector crashes

    To look at the STL source code, just put your mouse cursor over the #inciude <...> statement in your code, right click and choose Go To Document... The file will then open within VS. Note the code...
  12. Re: VB application Uploading files(Blobs) into Oracle

    Try the sister vb site which has a more active VB forum.
    https://www.vbforums.com/forumdisplay.php?25-Visual-Basic-NET
  13. Re: find if any duplicates within the struct in a vector

    Then just do it as per the suggested function in post #4

    For m_nId2, just extend the condition check in the function.
  14. Re: find if any duplicates within the struct in a vector

    std::unique() removes duplicate entries - which is not what you want as duplicates are allowed. You need std::find_if() with the predicate lambda to check m_nId == <required value> this will iterate...
  15. Re: find if any duplicates within the struct in a vector

    You mention adding a warning message - so you want to insert the item even if m_nId is a duplicate?

    Is the vector sorted by m_nID?

    Unless the vector is sorted by m_nID, then adjacent_find() is...
  16. Replies
    14
    Views
    364

    Re: My simple vector crashes

    1) Pass by const ref - so not passed by value, so no copy of the passed argument undertaken. In general unless a copy is required, only POD types (int, char etc) are passed by value - others are...
  17. Replies
    14
    Views
    364

    Re: My simple vector crashes

    I would code it as this which also includes an overload so that the contents of myVec can be displayed:



    #include <iostream>
    #include <initializer_list>
    #include <stdexcept>
    #include...
  18. Replies
    14
    Views
    364

    Re: My simple vector crashes

    OK. There is an ordering error in the initializer list constructor. The order of initialisation must be the same as the order the variables are defined. So you need as you're using sz before it's...
  19. Replies
    14
    Views
    364

    Re: My simple vector crashes

    What os/compiler are you using? This compiles and runs OK with VS2019. I've only added an include for initialiser list.



    #include <iostream>
    #include <stdexcept>
    #include <initializer_list>
    ...
  20. Replies
    14
    Views
    391

    Re: MFC CListCtrl change checkbox color

    [Attachment Link is invalid]
  21. Replies
    6
    Views
    376

    Re: Need to convert an INT to WORD*

    That still gives the compiler warning - as it's just the same as the (WORD*) c-style cast.
  22. Replies
    6
    Views
    376

    Re: Need to convert an INT to WORD*

    You are compiling as 64bit - Compiler warning C4312 - 'type cast': conversion from 'INT' to 'WORD *' of greater size is only issued when trying to assign a 32-bit value to a 64-bit pointer type, for...
  23. Replies
    2
    Views
    144

    Re: stl find_if iterator type

    As a set is sorted, you can't change it's key (value) as that would change the ordering. You need to erase (or extract for C++17) and insert.



    include <iostream>
    #include <algorithm>
    #include...
  24. Re: Removing the duplicates in the multiset (bit urgent)

    Whilst this solution will prevent the non-required duplicate entries, it will have an adverse effect on performance - as the multiset is effectively traversed twice - once to see if the cell doesn't...
  25. Replies
    15
    Views
    563

    Re: __asm equivalent for 64-bit programming

    Sorry, I got my count wrong :blush:

    Offset 28 is MXCSR_MASK

    From the manual page 284:



    This is what mxcsr_mask & (1<<6) is doing. It's testing if bit 6 is set - ie denormals-are-zero mode...
Results 1 to 25 of 2000
Page 1 of 80 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)