我是C的初学者,在下面的代码中,当它被转换为整数时,& str和str的输出值是什么。
int main()
{
char *str;
/* Initial memory allocation */
str = (char *) malloc(15);
strcpy(str, "Hello");
printf("String = %s, Address = %d ,val=%d\n", str, &str,str);
free(str);
return(0);
}
这是我得到的输出:
String = Hello,Address = -1407247144,val = 22335504