December 7th, 2003, 03:36 AM
std::string as function parameter
I have planty of functions which have std::string as parameter
the string value isn't change inside those functions (I send them as a const)
My question is, should I pass the std::string by value like it was int/double etc
or by reference like I do with structs?
const std::string myString
should I define func1 like this:
std::string func1(const std::string& myStr)
std::string func1(const std::string myStr)
is std::string is a big structure needs using reference?
thanks a lot
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!