Is it safe?# Programming - 葵花宝典
d*g
1 楼
I have a c++ function
void f(const char* c);
Is it safe to call
string s1,2;
s1 = sth;
s2 = sth2;
f((s1+s2).c_str());
It works but i am not sure if it is safe because the temporary viable.
Thanks.
void f(const char* c);
Is it safe to call
string s1,2;
s1 = sth;
s2 = sth2;
f((s1+s2).c_str());
It works but i am not sure if it is safe because the temporary viable.
Thanks.