doc Posted June 22, 2007 Share Posted June 22, 2007 i'm having a little trouble getting this to compile: UT_String tempVarName=""; evalString(tempVarName,temp_var_names.getToken(), &tempVarNameIndex,0,0); printf("tempVarName=%s\n",tempVarName()); here's the error I get: error: no match for call to `(UT_String) () but the doxygen pages list it as valid: operator char * () Can somebody point me in the right direction. Many thanks L Quote Link to comment Share on other sites More sharing options...
crunch Posted June 22, 2007 Share Posted June 22, 2007 i'm having a little trouble getting this to compile: UT_String tempVarName=""; evalString(tempVarName,temp_var_names.getToken(), &tempVarNameIndex,0,0); printf("tempVarName=%s\n",tempVarName()); here's the error I get: error: no match for call to `(UT_String) () but the doxygen pages list it as valid: operator char * () Can somebody point me in the right direction. Many thanks L printf() doesn't know to explicitly cast the UT_String to a (const char *), so you have to do the cast youself. printf("%s", (const char *)tempVarName); Oh, and you don't want to be calling the object (strip off the parentheses). Quote Link to comment Share on other sites More sharing options...
crunch Posted June 22, 2007 Share Posted June 22, 2007 date='Jun 22 2007, 05:14 PM' post='37036' Whoo hooo, I'm finally an initiate! (Edit: Now with the new look, maybe you should bump up the requirements and make me a Peon again). Quote Link to comment Share on other sites More sharing options...
doc Posted June 22, 2007 Author Share Posted June 22, 2007 printf("%s", (const char *)tempVarName); thanks crunch, that did the trick Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.