Einzelnen Beitrag anzeigen

mandoza

Registriert seit: 27. Apr 2018
16 Beiträge
 
#1

DLL export array of struct

  Alt 10. Okt 2018, 23:49
Hello i'v the following function that exports a single instance of a struct :

Code:
struct UserIdentity
{
std::string name;
int id;
};

std::map<std::string, int> g_UserIdentities = { { "Bob", 100 }, { "Jone", 101 },
            { "Alice", 102 }, { "Doe", 103 } };
           
/*
* Will be used in a DLL that will export UserIdentity struct
* OUT _UserIdentity
*/

void Ui_export(UserIdentity *_UserIdentity)
{
for (auto& t : g_UserIdentities)
    {
     _UserIdentity->name = t.first;
     _UserIdentity->id  = t.second;
    }
       
}
So please how could i export an array of _UserIdentity instead of a single instance in my function
Code:
void Ui_export(UserIdentity *_UserIdentity)
thank you .
  Mit Zitat antworten Zitat