I have function like this ,void foo(string &s); I call this function foo("hi") get a error such as Parameter mismatch,so I have to string s = "hi"; foo(s).Is there is way to call foo((string)("hi"))
void foo(string &s);
foo("hi")
Parameter mismatch
string s = "hi"; foo(s)
foo((string)("hi"))
I am new to C++.
Thanks!
Aucun commentaire:
Enregistrer un commentaire