#include<stdio.h>
#include<string.h>
void main()
{
FILE *in = NULL;
char *p = NULL;
char xx[3][3] = {0, };
int i = 0;
//打开in.dat文件,该文件中有两行数据,第一行为11,第二行为22
in = fopen("in.dat","r");
//第一次调用fgets函数
p = fgets(xx[0],4,in);
printf("\nxx[0] = %s",xx[0]);
printf("\np1 points: %x\n",*p);
printf("\np1 Value: %x\n",p);
printf("\np1 Address: %x\n",&p);
//第二次调用fgets函数
p = fgets(xx[0],4,in);
printf("\nxx[0] = %s",xx[0]);
printf("\np2 points: %x\n",*p);
printf("\np2 Value: %x\n",p);
printf("\np2 Address: %x\n",&p);
*p = NULL;
fclose(in);
};
[此贴子已经被作者于2007-7-10 0:35:17编辑过]