I want to create an EditBox whit a random name, like "Player234".
So , I do that :
Code: Select all
int DonneRandom ( int max ){
int r;
r = rand() % max +1;
return r;
}
wchar_t* DonneNomAleatoire(){
int r = DonneRandom(1000);
std::string nom = to_string(r);
wchar_t* wch = nom;
return wch;
}
wchar_t* text = DonneNomAleatoire();
Using the std::string is maybe a wrong way to define a random name.
How can I solve this problem ? Thanks for replies.