dimanche 26 juillet 2020

C++ how to change pointer type of a pointer to a vector of struct

I have a vector of struct that I need to change like so:

struct Something {
    int i = 0;
}

std::vector<Something>* vec;

I need to change the struct Something to Class::Something.

std::vector<class::Something>* vec;

I have tried reinterpret_cast but it doesn't work. I need to know if that is possible because im lost.

Btw the struct Something is copied in two .h files, one is in a class, the other is declared outside a class because it need too be exported out of a dll.

Aucun commentaire:

Enregistrer un commentaire