Answers for "C++ fill string with random uppercase letters"

C++
0

C++ fill string with random uppercase letters

#include <string>

using namespace std;

string CreateRandomChars(std::size_t ItemCount) {
    string str; 
    for(unsigned i=0;i<ItemCount;++i)
       str.push_back((rand() % 26) + 'A');
    return str;
}
Posted by: Guest on May-11-2021

Code answers related to "C++ fill string with random uppercase letters"

Browse Popular Code Answers by Language