请教这个程序错在哪,编译出错
读取一个文件数据生成另外一个文件#include <stdio.h>
#include <string.h>
#include <stdlib.h>
main()
{
char name,IPADD,port;
FILE *fp;
FILE *fp1;
char file[]="../1.cfg";
char file1[]="../1.xml";
if(fp=(fopen(file,"r"))==NULL)
{
printf("Can't open 1.cfg\n");
return 1;
}
if(fp1=(fopen(file1,"w"))==NULL)
{
printf("Can't open 1.xml");
return 1;
}
fprintf(fp1,"%s\n","<?xml>");
fprintf(fp1,"%s\n","<retCfg>");
do
{
fprintf(fp1,"%s\n","<rspcode>");
fscanf(fp,"%s",name);
fprintf(fp1,"<name>%s</name>\n",name);
fscanf(fp,"%s",IPADD);
fscanf(fp,"%s",port);
fprintf(fp1,"<value>%s|%s</value>\n",IPADD,port);
fprintf(fp1,"%s\n","<rscpode>");
}while(fscanf(fp,"%s",name)!=NULL);
return 0;
}