-
December 7th, 2003, 03:36 AM
#1
std::string as function parameter
Hello,
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?
I mean
const std::string myString
func1(myString)
should I define func1 like this:
std::string func1(const std::string& myStr)
or
std::string func1(const std::string myStr)
is std::string is a big structure needs using reference?
thanks a lot
avi
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|