Hey people, i am having the next easy problem but i dont find any answer on how to do that:
Im using libxml2 to read a XML file, in one part of my code i need to compare two attributes from different nodes which are numbers (1,2,3,4,5,6...). The problem is when i say "if (x == y) {}" it always pass it because cant compare xmlChars (at least thats what i think).
Im looking for some easy method to convert those values to int so i can do a comparission and solve the problem.
Thank you in advance!
the code:
for (resource; resource != NULL; resource = resource->next)
{
xmlChar *resource_id;
resource_id = xmlGetProp (resource, (const xmlChar *)"ID");
for (event; event != NULL; event = event->next)
{
xmlChar *event_id;
// event_id = xmlGetProp (event, (const xmlChar *)"ID");
x = xmlGetProp (event "ID");
if (resource_id == event_id)
{
std::cout << "parada 1" << std::endl;
}
}
}