+ 8
Random Class for CPP suggestions for improvements
Hello i have just made a Random Class for CPP, if there are suggestions for improvements please let me know https://code.sololearn.com/cMvGHpMRXvG2
3 Respuestas
+ 8
I have made some more changes.
Now it's a template and can return: int, ASCII characters and floats
https://code.sololearn.com/c69x0TgNRMpo
+ 7
Thanks Kinshuk Vasisht
I have made the first changes.
Now it's a template and can return ASCII characters, not yet floats
https://code.sololearn.com/cMzs7760Rj4j
+ 4
Sir, I just have one suggestion. Why not upgrade the class and make it a template class to return random characters, floats, etc?
Eg - random<char> randchar;
cout<<randchar.retrieve();
// The retrieve function will have to be
// specialized for all the types, though.
And it will be better to use the new <random> header introduced in C++03.