title: Memory Allocation program in C not working properly (Malloc, free)
body: <p>We are using : Turbo C3 Compiler on Windows XP.</p>
  
  <p>We have a question for following code snippet:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;conio.h&gt;
  #include&lt;stdlib.h&gt;
  #include&lt;string.h&gt;
    void main()
   {
    char *ptr;
    ptr=(char*)malloc(10*sizeof(char));
    strcpy(ptr,"data structure");
    printf("\n *ptr=%s \n add=%u",ptr,ptr);
    free(ptr);
    printf("\n *ptr=%s \n add=%u",ptr,ptr);
    getch();
   }
  </code></pre>
  
  <p>In the above program, even after freeing ptr, the value of ptr and address of ptr is showing correctly.</p>
  
  <p>Please tell the solution &amp; reason behind this problem.
  Thanks
  KB</p>