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

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -