char *available_resouces[]={
"color monitor",
"big disk",
"cray",
"mouse"
};
完全等同于:
char *available_resouces[4]={
"color monitor",
"big disk",
"cray",
"mouse"
};
展开来就是:
char *available_resouces[4]; //其实只分配了4个指针变量的空间
available_resouces[0]="color monitor";//字符串的地址在静态数据区,可读不可写。
available_resouces[1]="big disk";
available_resouces[2]="cray";
available_resouces[2]="mouse";