Why does sizeof(*“327”) return 1 instead of 8 on a 64 bit system?
问题 printf("%lu \n", sizeof(*"327")); I always thought that size of a pointer was 8 bytes on a 64 bit system but this call keeps returning 1. Can someone provide an explanation? 回答1: Putting * before a string literal will dereference the literal (as string literal are array of characters and will decay to pointer to its first element in this context). The statement printf("%zu \n", sizeof(*"327")); is equivalent to printf("%zu \n", sizeof("327"[0])); "327"[0] will give the first element of the