char *str;……printf("%p",str);是输出地址吗?还是只与str说占空间大小有关?
#include <stdio.h> 
#include <alloc.h> 
#include <string.h> 
int main(void) 
{ 
   char *str; 
   /* allocate memory for string */ 
   str = malloc(10); 
   /* copy "Hello" into string */ 
   strcpy(str, "Hello"); 
   printf("String is %s\n  Address is %p\n", str, str); 
   str = realloc(str, 20); 
   printf("String is %s\n  New address is %p\n", str, str); 
   /* free memory */ 
   free(str); 
   return 0; 
}
执行两次得到的结果是相同的。 
上次没说清楚。不好意思。



 
											





 
	    

 
	




