...

View Full Version : C++ strings



chiefbutz
07-10-2007, 09:53 PM
This sounds like such a stupid question, I can do this is PHP and VB6, but my teacher never told us how to in C++. Lets say I have a string, that will always be the same and this it is hard coded into the program with quotes around it, and then I have something that will change and I need to append that onto the end to place it in a function call. Can anyone tell me how to do this? I have included the equivelent in PHP below



theFunction("This is part one " . $appendthis);

oracleguy
07-10-2007, 10:55 PM
It depends what parameter theFunction takes. Is it using the string class or a char*?

If it is the former:



string appendthis;

//Your code

theFunction("This is part one" + appendthis);



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum