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++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -