fork(1) download
  1. #include<stdio.h>
  2. #include<string.h>
  3.  
  4. struct node {
  5. char str[10];
  6. int a;
  7. } x;
  8.  
  9. int main()
  10. {
  11. char *p;
  12.  
  13. strcpy(x.str, "12345");
  14.  
  15. printf(" x.str = %s\n", x.str);
  16. printf("&(x.str[0]) = %s\n", &(x.str[0]));
  17. p = &(x.str[0]);
  18. printf("p = %s\n", p);
  19.  
  20. printf(" x.str : (addr)%p\n", x.str);
  21. printf("&(x.str[0]) : (addr)%p\n", &(x.str[0]));
  22. printf("p : (addr)%p\n", p);
  23.  
  24. return 0;
  25. }
Success #stdin #stdout 0.02s 1676KB
stdin
Standard input is empty
stdout
  x.str     = 12345
&(x.str[0]) = 12345
p           = 12345
  x.str     : (addr)0x804a01c
&(x.str[0]) : (addr)0x804a01c
p           : (addr)0x804a01c