代码运行老出问题,走过路过不要错过啊
#include "stdio.h"#include"stdlib.h"
#include "string.h"
void main()
{
int i,j;
int n1;
FILE *fp;
char *st02="e:\\欠款\\";
char st1[60],st2[30];
struct pressnum
{
float press;
int num;
} pn[1],*pp;pp=pn;
printf(" aboutpeople欠款信息 : \n");
printf("请输入人的姓名:\n");
scanf("%s",st2);
strcpy(st1,st02);
for(j=0;st1[j]!='\0';)
j++;
for(i=0;st2[i]!='\0';i=i+1)
st1[j+i]=st2[i];
st1[j+i]='\0';
printf("\naddress:\n");
printf("%s",st1);
printf("\n");
fp=fopen(st1,"at+");
if(fp==NULL)
{
printf("Open file error,press any key exit!\n");
exit(0);
} 这里这里
printf("输入物品单价,物品数量:\n");
pp=pn;
scanf("%lf%d",&pp->press,&pp->num);
fwrite(pp,sizeof(struct pressnum),1,fp); 到这里 是不是有问题啊
fclose(fp);
}
帮忙看看啊