libxml2 xmlChar* cast to char*

mobilekid picture mobilekid · Feb 17, 2010 · Viewed 16.9k times · Source

How would you convert / cast an xmlChar* to char* from the libxml2 library? Thanks.

Answer

darelf picture darelf · Feb 17, 2010

If you take a look at the examples, for instance io2.c, you'll notice that they just blithely cast it to a char *:

printf("%s", (char *) xmlbuff);