In the follwoing code, using libxml libraries :
key = xmlNodeListGetString(doc, cur3->xmlChildrenNode, 1);
if (flag == 1)
{
image2 = key;
printf("the image 2 is %s \n", image2);
flag = 2;
}
if(flag == 0)
{
image1 = key;
printf("the image 1 is %s \n", image1);
flag = 1;
}
//printf("SRC of the file is: %s\n", key);
xmlFree(key);
printf("the image 1 is %s \n", image1);
the two printf are giving me different outputs.
The output is :
the image 1 is 1.png
the image 1 is 0p� g
the image 2 is 2.png
the image 1 is 0p� g