title: Error in a simple C code (pointers)
body: <p>In the follwoing code, using libxml libraries :</p>
  
  <pre><code>key = xmlNodeListGetString(doc, cur3-&gt;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);
  </code></pre>
  
  <p>the two printf are giving me different outputs.</p>
  
  <p>The output is : </p>
  
  <pre><code>the image 1 is 1.png 
  the image 1 is 0p�  g 
  the image 2 is 2.png 
  the image 1 is 0p�  g
  </code></pre>