标题:代码运行老出问题,走过路过不要错过啊
取消只看楼主
luxiaoke654
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2013-5-26
结帖率:0
 问题点数:0 回复次数:1 
代码运行老出问题,走过路过不要错过啊
#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);            
}





帮忙看看啊
搜索更多相关主题的帖子: include 信息 姓名 
2013-09-04 13:11
luxiaoke654
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2013-5-26
得分:0 
回复 2楼 rjsp
谢了啊,不过我发帖已经没分了,要不你去我别的贴随便打几个字我给你点数
2013-09-04 16:52



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-420083-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.769797 second(s), 11 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved