Comment utiliser (void* data)
Bonjour,
je voudrais récupérer le contenu d'une méthode :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| void init()
{
static const void* type =
{
static_cast<void*>(new std::string("it's easy to break stuff like this!"))
};
test(&type);
}
void test(void* vp)
{
//void* vp = static_cast<void*>(new std::string("it's easy to break stuff like this!"));
std::string* sp = static_cast<std::string*>(vp);
std::string monType = *sp;
String^ type = gcnew String(monType.c_str());
Console::Write(type);
} |
mais je récupère une valeur vide quand je lance init()
Merci