c语言中的指针数组

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/linxizi0622/article/details/72851583

指针数组,数组元素是一个指针

附上代码

#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

猜你喜欢

转载自blog.csdn.net/linxizi0622/article/details/72851583