mercredi 2 août 2017

type cast when passing function parameter in C++

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"))

I am new to C++.

Thanks!

Aucun commentaire:

Enregistrer un commentaire