std::string myString = {100, 'A'};
initialized using a list of initializers. It creates a string with two characters: one with code 100 and "A"
std::string myString(100, 'A');
calls the following constructor:
string (size_t n, char c);
which creates a string with 100 'A
user2155932
source share