问个指针数组的问题,谢谢
#include<iostream>
using namespace std;
void Print(char* arr[])
{
while(*arr != NULL)
{
cout<<(int)*arr<<" "<<*arr<<endl;
arr++;
}
}
int main()
{
char* pn[] = {"Fred","Barney","Wilma","Betty",NULL};
Print(pn);
return 0;
}
输出是
4636728 Fred
4636720 Barney
4636712 Wilma
4636704 Betty
Press any key to continue
为什么每个字符串常量占8个字节
而且前面的地址大?