В follwoing код на, используя библиотеки Libxml:Ошибка в простом коде C (указатели)
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);
два Printf дают мне разные выходы.
Выход:
the image 1 is 1.png
the image 1 is 0p� g
the image 2 is 2.png
the image 1 is 0p� g
Спасибо, что он работал как шарм. – w2lame