1. 程式人生 > >c語言中的指標陣列

c語言中的指標陣列

指標陣列,陣列元素是一個指標

附上程式碼

#include <stdio.h>
#include <stdlib.h>


/* run this program using the console pauser or add your own getch, system("pause") or input loop */


int main(int argc, char *argv[]) {
char *conf[]={"hello","world"};
int i;
for( i=0;i<=1;i++)
printf("%s ",conf[i]);

return 0;
}

conf[0]儲存的是字串"hello"的首地址

conf[1]儲存的是字串"world"的首地址

程式碼的輸出為hello world