المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How to append a character to a string



C++ Programming
12-29-2010, 01:40 AM
I am trying to do something like this. But it is giving error


string string1 = "abc", string2;

string::iterator it = string1.begin();

while ( it != string1.end() )
{
string2.append(*it);
it++;
}