//完成链表的文件存储和读取

#include<stdio.h>

struct QQ
{
int QQ_Number;
char Pet_name[41];
};


QQ ALL_Information[5]={
{88888888,"test"},
{88888888,"test"},
{88888888,"test"},
{88888888,"test"},
{88888888,"test"}
};

/*
//写操作开始

void WriteToFile(char* FileName)
{
printf("\t\t\t^_^ 保存成功!\n");
FILE* pFile=fopen(FileName,"w+");//能存能写
for(int nI=0;nI<5;nI++)
{
   fprintf(pFile,"QQ:%d\t\t昵称:%s\n",
    ALL_Information[nI].QQ_Number,
    ALL_Information[nI].Pet_name);
}
fclose(pFile);
}

//写操作结束
*/


//读操作开始
void ReadFormFile(char FileName[50])
{
printf("\t\t\t^_^ 读取完成!\n");
FILE* pFile=fopen(FileName,"r");//能写能存
int QQ_Number=0;
char Pet_name[41];
/* while(1)
{
   int nRes=fscanf(pFile,"QQ:%d\t\t昵称:%s\n",&QQ_Number,Pet_name);
   //if(nRes==1)break;
   //printf("QQ:%d\t\t,昵称:%s\n",QQ_Number,Pet_name);
}*/
// fclose(pFile);
}
//读操作结束


void main(void)
{
//WriteToFile("g:\\腾讯QQ信息.txt");//文件写操作
       ReadFormFile("g\\腾讯QQ信息.txt");//文件读操作
}