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

Search:

Type: Posts; User: Yadrif

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    6
    Views
    4,373

    Re: Byte Array to double Conversion

    Thanks for the help. I am starting resolve my misunderstanding.

    I don't understand why the following code has the & after the type to cast to:


    reinterpret_cast<double&>(piAsLong);


    I read...
  2. Replies
    6
    Views
    4,373

    [RESOLVED] Byte Array to double Conversion

    Hi Everyone.

    I'm trying to understand why a conversion from a byte array (unsigned char) to a double works when done one way and not antoher.

    In the example code I test by hard coding an...
  3. Replies
    5
    Views
    2,160

    Re: Class does not name a type error

    I think you need to #include Parser.h in Parser.cpp
  4. Re: Compile Error with Static Template Function (VS vs. g++)

    I did not know about the warning level. I made the change.

    Also, I read about lvalue and rvalue and now understand more what is going on. I would like to mark the argument as const but in the real...
  5. [RESOLVED] Compile Error with Static Template Function (VS vs. g++)

    The below code compiles without error using VS 2012 but with g++ 4.1.2 I get this error:



    main.cpp: In function 'int main(int, char**)':
    main.cpp:37: error: no matching function for call to...
  6. Replies
    3
    Views
    859

    Re: Strangley placed else

    Thanks very much.
  7. Replies
    3
    Views
    859

    [RESOLVED] Strangley placed else

    In this code snippet what does the line (line 20) that reads



    else ;


    cause to the flow of the program, if anything? If it does nothing why would someone have it there?
  8. Replies
    8
    Views
    4,657

    Sharing struct between C and C++

    I am attempting to use C code from C++ and am having trouble sharing a struct between the two languages.

    Currently I am able to get everything to compile by defining the struct in both the C++...
  9. Replies
    12
    Views
    1,102

    Re: Some cyclic references problem

    In NodePool.h you could use only the forward declaration for CObjects and put the implementation of the function



    float getCost(CObjects* unit)


    in a .cpp file with the #include for...
  10. Re: [RESOLVED] Move elements from one container to another without loop

    Thanks for everyone's help. I was so focused on finding an algorithm to do this in one call I didn't think to copy then erase.

    Once again thank you guys for your help.
  11. Re: Move elements from one container to another without loop

    Is your example only removing the elements from dataQ that are copied to data_array?

    I see



    dataQ.clear()


    But that will drop all elements not just what was copied with std::copy. Or...
  12. Re: Move elements from one container to another without loop

    I'm not taking all of the data from the dataQ only what is requested by the caller of the function. The size variable is the amount of data requested by the caller. Int he real code data_array is a...
  13. [RESOLVED] Move elements from one container to another without loop

    Is there an algorithm in the STL to move elements similar to how std::copy works? I have read various places that the new C++ standard has a move algorithm. Unfortunately the compiler I use (g++...
  14. Replies
    24
    Views
    12,163

    Re: problem with push_back

    Usually setter functions take a const reference and return void.

    For example:


    void person::set_person(const string& n)
    {
    ...
    }
  15. What does synthesized method first required here mean?

    Hi Everyone.

    I'm getting a few messages like this from the gcc (version 4.1.2) compiler.

    [cc] /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_construct.h:81:...
  16. Passing By Reference then Deleting the Passed Object

    Why does the following code not break after delete bar? It seems like the object foo would have a reference to a deleted object and crash in printBar(). Is bar not really gone after the "delete bar"...
  17. Multiple threads on single CPU vs. multiple CPU

    In general what are the additional or special things to be concerned about and watch out for when making a multi threaded app run correctly on a multiple CPU machine?

    I remember from a while back...
  18. Re: [RESOLVED] How to use a derived function for std::priority_queue Compare

    I figured it out.

    I ended up adding a template parameter to ProcessingQueue and using that as the thrid template parameter to std::priority_queue.
    I created a default Comparer with the signature...
  19. Re: How to use a derived function for std::priority_queue Compare

    I was expecting the user to supply the comparison function at compile time. My theory was that they would derive a class from Comparer and override operator().

    Either was is probably okay as the...
  20. [RESOLVED] How to use a derived function for std::priority_queue Compare

    I have a template class that contains a std::priority_queue and would like for the user of this class to be able to pass in the functor object that is used for comparison. Here is the code I have but...
  21. Replies
    1
    Views
    6,631

    [RESOLVED] Enum in template class

    Can anyone help with the cause and resolution to this compile error?

    Here is the code:


    template <typename T>
    class BigQueue {
    public:
    enum QueueState {GOOD, BAD,...
  22. Replies
    1
    Views
    2,075

    PTHREAD_MUTEX_INITIALIZER being typeless

    I found a comment in code stating that PTHREAD_MUTEX_INITIALIZER is typeless then the following code:



    const pthread_mutex_t pthread_mutex_initer = PTHREAD_MUTEX_INITIALIZER;


    then...
  23. Replies
    4
    Views
    479

    Re: Linker Error Help

    Do you mean the linker is trying to find libXyz.so or the .so that the some_symbol is defined in?

    Thanks for your help.
  24. Replies
    4
    Views
    479

    Linker Error Help

    Hi Everyone,
    In general what is the following linker error indicating?

    /app/lib/libXyz.so: undefined reference to `some_symbol'

    Using g++ compiler on Linux.

    I get multiple of these all...
  25. Replies
    1
    Views
    1,468

    Generate CRUD Operations

    Hi Everyone,
    I have a physical data model in Rose Data Modeler and ERwin. I would like to generate CRUD operations in Java but do not see an option for this in either Rose or ERwin.

    Is there...
Results 1 to 25 of 36
Page 1 of 2 1 2





Click Here to Expand Forum to Full Width

Featured