There doesn't seem to be a standard constructor so I've taken to doing the following
void myMethod(char delimiter = ',') { string delimiterString = 'x'; delimiterString[0] = delimiter; // use string version ... }
Is there a better way to do this?
std::string has a constructor that will do it for you:
std::string
std::string delimiterString(1, delimiter);
The 1 is a size_t and denotes the number of repetitions of the char argument.
size_t
char