指针数组

#include<stdio.h>#include<windows.h>int main(void){ char *str[3]; //定义一个指针数组,该数组含有10个指针元素 int i=0; for(i; i<3; i++) { str[i]=(char *)malloc(20*sizeof(char)); //为每一个指针分配20个字符长度的空间 printf("Please input string for str[%d]!\n",i); gets(str[i]); //向每...
默认分类 | 2008-08-10 17:57 | 阅读 3682 次 | 评论 1 条
文章分类
文章归档