Código
//Al principio era: vector<string> split(string str,char c); void split(string str, char c,vector<string>* strings){ stringstream stream(str); string item; while (getline(stream, item, c)){ strings->push_back(item); } }
Luego:
Código
HMODULE lib = LoadLibrary("C:\\Users\\Dimitar\\Documents\\Visual Studio 2013\\Projects\\BasicTools\\Release\\BasicTools.dll"); if (lib == NULL){ e("Library failed to load!"); } _split split = (_split)GetProcAddress(lib, "split"); if (!split){ e("Failed to load split!"); } string test = "Hola me llamo Jose!"; vector<string> strings; split(test, ' ', &strings); for (auto str : strings){ cout << str << endl; }
Recibo error por alocar memoria, me lo esperaba...
Hay alguna manera de exportar vector y string?
Un saludo