🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
function which has char* parameter...
If a fucntion has a char* parameter like this:
void print(const char* pMsg);
And I registed this function with description string:
void print(const string & in)
Then, the parameter cannot be passed correctly. How do you resolve this problem?
In this case you'll have to write a wrapper.
void print(const char *pMsg);void wrapper_for_print(const string &msg){ print(msg.c_str();}r = engine->RegisterGlobalFunction("void print(const string ∈)", asFUNCTION(wrapper_for_print), asCALL_CDECL); assert( r >= 0);
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement