string3=string1.concat(string2);
how can I write a "concat" function which does this work with using class.
string3=string1.concat(string2);
how can I write a "concat" function which does this work with using class.
Are you writing you own string class?
If not, the standard library has all this ready for you. You simply do the following:
string3 = string1 + string2;
or, to add string2 to string1:
string1 += string2;
If you look at the basic_string class method list, you will see a whole list of operaters.
If you are writting your own class, declare a function concat that takes a string object as argument, and do the concatenation yourself( I assume that you are storing the string as char *), using pointers.
none...