6/7/2023 0 Comments Convert string to char![]() if the function modified theĪFunctionAPI(myFoo.c_str()) //this is not compilingĪFunctionAPI(const_cast(myFoo.c_str())) //this is not safe std::stringĪFunctionAPI(myFoo.str()) //this is fine ĬharT const * from std::basic_string std::string const cstr = Īnd you can use it as: void aFunctionAPI(char* input) ĪFunctionAPI("Foo") //this call is not safe. Returns: A pointer p such that p i =
0 Comments
Leave a Reply. |