The following fails with the error prog.cpp:5:13: error: invalid conversion from ‘char’ to ‘const char*’
prog.cpp:5:13: error: invalid conversion from ‘char’ to ‘const char*’
int main() { char d = \'d\'; std::s
str.append(10u,'d'); //appends character d 10 times
Notice I have written 10u and not 10 for the number of times I'd like to append the character; replace 10 with whatever number.