-
String concatination
Hi freind I have a doudt
here is my code
Code:
void endtag(string& label)
{
string temp2;
string str1;
string str2;
str1= "\" ;
str2=readlabel(temp);
if(str2!= (str1+label))
{
cout<< " end tag is wrong "<<endl;
}
}
I am not able to add (' \' to label )=like this "\book" assume the label here is book .can I do this....
help me please.......
-
yes, assuming that your string is an std::string
-
The \ is a special character you need to "escape" by putting another \ in front of it like \n (newline), \t (tab), etc... So, it should be "\\" and not "\".