因为C++标准库中I/O类对<<操作符重载,在遇到char指针时会将其当作字符串来处理,所以会输出"ox",如果想输出地址,可以将其转换成void指针或是使用printf。
cout << (void*)&animal[1] << endl;printf("%p\n", &animal[1]);