Search:

Type: Posts; User: Krones

Search: Search took 0.01 seconds.

  1. Replies
    7
    Views
    1,908

    so a std::vector would work, and I just...

    so a std::vector<3DModel*> would work, and I just got adding pointers to it after I load the models? Then ofc, reminding to clean it all up after I'm done with them.
  2. Replies
    7
    Views
    1,908

    Even if b was a pointer, is b->model still valid,...

    Even if b was a pointer, is b->model still valid, even if I change the vector models? Because it points to a region in the memory that may have been moved when the push_back was called.
  3. Replies
    7
    Views
    1,908

    The following should help to clarify. it's not...

    The following should help to clarify. it's not actual code, but it shows what I'm trying to figure out.



    struct Entity{
    3DModel *model;
    }

    std::vector<3DModel> models;
  4. Replies
    7
    Views
    1,908

    Keep track of elements inside STL vector

    Hi
    I would like to know what is the best way (if there is one) to keep track of an element inside an STL vector.
    Consider I have some big object 3D models, that take up a lot of space each,...
  5. Replies
    17
    Views
    5,440

    Ty! That was the answer I needed :) Thx a lot ...

    Ty! That was the answer I needed :) Thx a lot

    Krones
  6. Replies
    17
    Views
    5,440

    When is it better doing each thing?

    When is it better doing each thing?
  7. Replies
    17
    Views
    5,440

    I'm just asking if it's better to copy data and...

    I'm just asking if it's better to copy data and free the pointer or if it's ok to point to it without freeing the pointer. Feel free to ignore the code if you think it contain errors, as long as you...
  8. Replies
    17
    Views
    5,440

    Assuming they are NULL-terminated strings. If you...

    Assuming they are NULL-terminated strings. If you didn't get what I meant, use memcpy with a a random size then, I didn't want to come up with another variable. This is an _example_ code, it doesn't...
  9. Replies
    17
    Views
    5,440

    This: struct example { unsigned char...

    This:


    struct example
    {
    unsigned char *storageArea;
    unsigned char *storageArea2;
    unsigned char storageArea3;
    };
  10. Replies
    17
    Views
    5,440

    Because it needs to be processed first... A part...

    Because it needs to be processed first... A part of it will go to one storage area, then another part will go to another and so on. Then I may need to use storageArea = &packet[x] storageArea2 =...
  11. Replies
    17
    Views
    5,440

    Yep, but would it be more efficient than using a...

    Yep, but would it be more efficient than using a buffer? Estimate a length and memcpy the contents of the packet to the storage area and free(packet)?
  12. Replies
    17
    Views
    5,440

    Packet is the pointer that was set using...

    Packet is the pointer that was set using malloc(), and storageArea is another pointer, where the data will be stored. If I do "storageArea = &packet[x]", "free(packet)" and then do something with...
  13. Replies
    17
    Views
    5,440

    malloc() vs buffer[]?

    I wanted to know the difference between using malloc() to allocate data to a pointer and creating an array[].
    I'm writing a program that gets data from the internet and stores a part of it. It...
Results 1 to 13 of 13