What do I have to do so that when I
string s = ".";
If I do
cout << s * 2;
Will it be the same as
cout << "..";
?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No,
std::stringhas nooperator *. You can add (char, string) to other string. Look at this http://en.cppreference.com/w/cpp/string/basic_stringAnd if you want this behaviour (no advice this) you can use something like this
http://liveworkspace.org/code/52f7877b88cd0fba4622fab885907313