Search
 
SCRIPT & CODE EXAMPLE
 

CPP

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;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: remove element from vector 
Cpp :: convert 2d array to 1d c++ 
Cpp :: a square plus b square plus c square 
Cpp :: insert image using set atribute 
Cpp :: how to compare two char* in c++ 
Cpp :: c elif 
Cpp :: classes constructor in c++ 
Cpp :: Convert a hexadecimal number into decimal c++ 
Cpp :: automatic legend matlab 
Cpp :: iterate vector c++ 
Cpp :: c++ vector remove all duplicate elements 
Cpp :: how to download c++ portable compiler 
Cpp :: C++ Increment and Decrement 
Cpp :: accumulate() in c++ 
Cpp :: SUMOFPROD2 
Cpp :: doubly linked list code in c++ 
Cpp :: How to turn an integer variable into a char c++ 
Cpp :: double array size c++ 
Cpp :: sum array c++ 
Cpp :: lower bound and upper bound in c++ 
Cpp :: print in c ++ 
Cpp :: operator precedence in cpp 
Cpp :: one dimensiol array to two dimen c++ 
Cpp :: c++ multiply char 
Cpp :: what is function c++ 
Cpp :: c++ pop string from vector 
Cpp :: Character cin(userInput) in c++ 
Cpp :: c++ classes 
Cpp :: __builtin_popcount 
Cpp :: dangling pointer 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =