C语言指针与一维数组
代码如下:
#include <stdio.h>#include <stdlib.h>int main(void) {char hello[] = {'h', 'e', 'l', 'l', 'o'};char *p = hello;//printf("%s\n", hello);printf("hello is : %x\n", hello);printf("&hello is : %x\n", &hello);printf("&hello[0] is : %x\n", &hello[0]);printf("p is : %x\n", p);printf("&(*p) is : %x\n", &(*p));printf("*(&p) is : %x\n", *(&p));printf("&p is : %x\n", &p);return EXIT_SUCCESS;}
hello is : 22ff4b&hello is : 22ff4b&hello[0] is : 22ff4bp is : 22ff4b&(*p) is : 22ff4b*(&p) is : 22ff4b&p is : 22ff44