What are the differences

guys i have two items below and i just want to know the differences between them.

1. myfunction(std::string("first word") + " " + "second word");
2. myfunction("first word" + " " + "second word");

void myfunction(std::string buff)
{
...
}


Thanks in advanced,
1: the pointer "first word" is converted to an std::string, so the + is std::string operator + ( const string&, const char*)
2: the pointer is not converted so it could generate errors unless the compiler converts it implicitly
thanks man for the your reply.
unless the compiler converts it implicitly

Which will never happen.
Topic archived. No new replies allowed.