I'm trying to contatenate xmlChar* strings to append ".rels" onto the filename. For some reason, I see the errors:
- error c2440 initializing cannot convert from const char[6] to const xmlChar *.
- A const_cast can only adjust type qualifiers; it cannot change the underlying type.
xmlChar is defined from xmlstring.h, libopc/libxml2, since I know not everyone knows about xmlChar.
xmlChar * temp = c->part_array[i].name; //this is a filename.doc with path, has no compile error
const xmlChar* temp2 = const_cast<xmlChar*>(".rels"); //"rels" here has error
xmlStrcat(temp, temp2);
xmlStrcat wants xmlStrcat(xmlChar* cur, const xmlChar* add), which I think I have, once I get temp2 to be happy.
Any ideas? I'm having trouble finding xmlChar* examples where it's casted like this. I tried using just:
const xmlChar* temp2 = ".rels";
but get the error:
error c2440 initializing cannot convert from const char[6] to const xmlChar*
I wound up having to use xmlStrndup and xmlCharStrndup