🎉 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...

Started by
0 comments, last by WitchLord 18 years, 8 months ago
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?
Advertisement
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);


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement