C pointers and malloc confusion between &str,str -
im beginner in c,in following code can output value of &str , str when cast integer.??
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); }
this output got:
string = hello, address = -1407247144 ,val=22335504
Comments
Post a Comment