Jump to content

Trouble Wth Ut_string


Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...