It depends what you're using to store your strings.
If you're using std::string (i.e. you probably got hold of the strings from iostream) then concatenation is simple through the operators built into std::string, + and +=. e.g.:
If however you're using plain char* for your string then you'll need to a function, strcat from stdio.h is standard.Code:using namespace std; string toasties = "toasties"; string cheese = "cheese"; string food = toasties + " " + cheese; food += " mmmm"; cout << food << endl;
LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks