0

How could I make program in C++ who generate random names and surnames?

7th Jul 2017, 10:58 AM
Matija Behin
Matija Behin - avatar
2 Respuestas
7th Jul 2017, 12:06 PM
Frost
Frost - avatar
+ 2
Just generate random bytes in specific range (see ASCII table) and append each one to the string in for cycle. string s; for (int i = 0; i < 5; ++i) { // ch = Use std::rand() from <cstdlib> s.push_back (ch); } // cout << s
7th Jul 2017, 12:09 PM
soman