| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 473 人关注过本帖
标题:一份课程设计 编译没有错 调试出现link。exe错误求助
取消只看楼主 加入收藏
haoxianwen
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2012-12-22
结帖率:0
收藏
已结贴  问题点数:20 回复次数:2 
一份课程设计 编译没有错 调试出现link。exe错误求助
#include<stdio.h>        //??????
#include<string.h>       //????????
#include<stdlib.h>
#include<conio.h>        //????
#include<malloc.h>      //????
#define MAXNAME 11     //??????
#define MAXwriter 21   
#define MENU_COUNT 5   //??????
#define MAXN 15
 //???????fi_type,????????
typedef enum _fi_type   
{
    news=1,     //????
}fi_type;
//???????
struct fi_info
{char name[MAXNAME];
 char writer[MAXwriter];
 int typenum;
 char publish_from[MAXN];
 int publish_time;
 float price;
 fi_type type;
 struct fi_info* next;     //???????,??????????????
};
struct fi_info *head=NULL,*head_=NULL ;   //?????????,???????
int Book_num;    //????????
void menu();
int ReadinfoFromFile();   //????
//????
int creat_news();
void search_news();
void delete_news();
void update_news();
void show();
void quit();
int  main()
{
    int selected=0,land_num;  //??????
    ReadinfoFromFile();//????  
    printf("??????????????:");
    scanf("%d",&land_num);
    while(selected>=0&&selected<=MENU_COUNT)
    {
        system("cls");   //??
        menu();    //?????
        printf(">?????????(%d_%d):",0,MENU_COUNT);
        if(scanf("%d",&selected)!=1||selected<0||selected>MENU_COUNT)
        {
            printf(">????!???(%d-%d)?????!??????...",0,MENU_COUNT);
            fflush(stdin);   //???????
            getchar();
        }
        else
        {   
            
            switch(selected)
            {
                case 1:creat_news();break;
                case 2:search_news();break;
                case 3:delete_news();break;
                case 4:update_news();break;
                case 5:show();break;
                case 0:quit();
            }
        }
        selected=0;
    }
    return 0;
}
int ReadinfoFromFile()   //????
    {
     FILE *fp=NULL;   //????
     struct fi_info *p=NULL;    //?????
     int i;
     if((fp=fopen("sun.txt","r+"))==NULL)
         {
             printf("?????!\n");
          fp=fopen("sun.txt","w");   //?????????
          printf("??????!\n");
        }
        fscanf(fp,"%d",&Book_num);  ////???????????????,?????for???????
        for(i=0;i<Book_num;i++){
            p=(struct fi_info*)malloc(sizeof(struct fi_info));  //P?????,??????
            fscanf(fp,"%s",p->name);
            fscanf(fp,"%s",p->writer);
            fscanf(fp,"%d",&p->typenum);
            fscanf(fp,"%s",p->publish_from);
            fscanf(fp,"%d",&p->publish_time);
            fscanf(fp,"%f",&p->price);
            fscanf(fp,"%d",&p->type);            
            if(p->type==1)  
            {
              if(head==NULL){
                head=p;
                p->next=NULL;
              }
           else{
                p->next=head;
               head=p;        
                }
            }
           else{
                 if(head_==NULL){
                head_=p;
                p->next=NULL;
                }
                else{
                 p->next=head_;
                 head_=p;        
                }
            }
        
        }
        fclose(fp);
        return 0;
}
void menu(){
    printf("\n\n*******************************????????********************************\n");
            printf("\t\t\t      1;??????\n");
            printf("\t\t\t      2;??????\n");
            printf("\t\t\t      3;??????\n");
            printf("\t\t\t      4;??????\n");
            printf("\t\t\t      5;??????\n");
            printf("\t\t\t      0;?? \n");   
}
int creat_news()     //??????
{
    struct fi_info *p=NULL;
       p=(struct fi_info*)malloc(sizeof(struct fi_info));        
    printf("?????:");
    scanf("%s",p->name);
    printf("??????:");
    scanf("%s",p->writer);
    printf("??????:");
    scanf("%d",&p->typenum);
    printf("???????:");
    scanf("%s",p->publish_from);
    printf("???????:");
    scanf("%d",&p->publish_time);
    printf("???????:");
    scanf("%f",&p->price);
    p->type=news;
    Book_num+=1;
    p->next=head;
    head=p;
    return 0;
}
void search_news()      //??????
{
   struct fi_info *p=NULL;
   char name[10],writer[21];
   int price;
   int b=1,i;
   printf("???????1.\n????????2.\n???????3.\n");
   scanf("%d",&i);
   if(i=1)
   {
   printf("?????????:");
   scanf("%s",name);
      for(p=head;p!=NULL;p=p->next)   //??????p???,????p==NULL
      {        
        if(strcmp(name,p->name)==0)   //????????,????????0
        {       b=0;                        //???,?b=0     
            printf("????????????:\n");
            printf("%s\n",p->name);
            printf("%s\n",p->writer);
            printf("%d\n",p->typenum);
            printf("%s\n",p->publish_from);
            printf("%d\n",p->publish_time);
            printf("%f\n",p->price);
        }   
      }
      if(head==NULL) printf("???????\n");
      if(b) printf("????????????!\n"); //?b=1,????
   }
else  if(i=2)
{  
   printf("??????????:");
   scanf("%s",writer);
      for(p=head;p!=NULL;p=p->next)   //??????p???,????p==NULL
      {        
        if(strcmp(writer,p->writer)==0)   //????????,????????0
        {       b=0;                        //???,?b=0     
            printf("????????????:\n");
            printf("%s\n",p->name);
            printf("%s\n",p->writer);
            printf("%d\n",p->typenum);
            printf("%s\n",p->publish_from);
            printf("%d\n",p->publish_time);
            printf("%f\n",p->price);
        }   
      }
      if(head==NULL) printf("???????\n");
      if(b) printf("????????????!\n"); //?b=1,????
   }
 else if(i=3)
   {
   printf("??????? ?? ??\n:");
   scanf("%s %d",name,&price);
      for(p=head;p!=NULL;p=p->next)   //??????p???,????p==NULL
      {        
        if(strcmp(name,p->name)==0&&price==p->price)   //????????,????????0
        {       b=0;                        //???,?b=0     
            printf("????????????:\n");
            printf("%s\n",p->name);
            printf("%s\n",p->writer);
            printf("%d\n",p->typenum);
            printf("%s\n",p->publish_from);
            printf("%d\n",p->publish_time);
            printf("%f\n",p->price);
        }   
      }
      if(head==NULL) printf("???????\n");
      if(b) printf("????????????!\n"); //?b=1,????
 } else printf("??:???????,?????:\n");
      system("PAUSE");      //??
}
void delete_news()      //??????
{
 struct fi_info *p=NULL;    //?????????
 struct fi_info *q=NULL;
 char name[10];
 int b=1;
 int a;
 printf("?????????:\n");
 scanf("%s",name);
    for(p=head,q=head;p!=NULL;p=p->next)
     {
        if(strcmp(name,p->name)==0)
     {
        b=0;
        printf("????? 0(?) or 1(?)\n");
        scanf("%d",&a);
        if(a==0)
        {
             if(p==head)
            head=head->next;
           else
             q->next=p->next;
             printf("????!\n");
        }        
     }
        else q=p;   
     }
      if(b)  printf("??:???????\n");
 system("PAUSE");
 }
void update_news()    //??????
{
  struct fi_info *p=NULL;
  int a,b=1;
  char name[10];
  printf("?????:\n\n");
  scanf("%s",name);
  for(p=head;p!=NULL;p=p->next)
  {
        if(strcmp(p->name,name)==0){     
        b=0;     
        printf("%s\n",p->name);
      printf("%s\n",p->writer);
      printf("%d\n",p->typenum);
      printf("%s\n",p->publish_from);
      printf("%d\n",p->publish_time);
      printf("%f\n",p->price);
      printf("??????? 0 (?)or 1(?)\n");
      scanf("%d",&a);
      if(a==0){
        printf("**********???????*********\n");
        canf("%d",&p->typenum);
      printf("???????:");
      scanf("%s",&p->publish_from);
      printf("???????:");
      scanf("%d",&p->publish_time);
      printf("???????:");
      scanf("%f",&p->price);
      p->type=news;      
      printf("\n\n ??:?????!\n\n");
      }   
  }   
  if(b==1) printf("?????????!\n");
  }
  system("PAUSE");
}  
void show()     //??????
{
struct fi_info *p=NULL;
system("cls");
for(p=head;p!=NULL;p=p->next)
{   
    printf("%s\n",p->name);
    printf("%s\n",p->writer);
    printf("%d\n",p->typenum);
    printf("%s\n",p->publish_from);
    printf("%d\n",p->publish_time);
    printf("%f\n",p->price);
    system("PAUSE");
}
}
 void quit()    //????    ?????
{  FILE *fp=NULL;
    struct fi_info *p=NULL;
system("cls");
fp=fopen("sun.txt","w");
    fprintf(fp,"%d ",Book_num);
 for(p=head;p!=NULL;p=p->next)
 {  fprintf(fp,"%s ",p->name);
    fprintf(fp,"%s\n ",p->writer);
    fprintf(fp,"%d ",p->typenum);
    fprintf(fp,"%s ",p->publish_from);
    fprintf(fp,"%d ",p->publish_time);
    fprintf(fp,"%f ",p->price);
    fprintf(fp,"%d ",p->type);
 }
   printf("\n");
   printf("?????????????!\n") ;
   printf("\n");
   fclose(fp);
   exit(0);
}
搜索更多相关主题的帖子: 课程 设计 include price 
2012-12-22 22:38
haoxianwen
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2012-12-22
收藏
得分:0 
回复 2楼 yudeyinji198
--------------------Configuration: 1230120 - Win32 Debug--------------------
Linking...
LINK : fatal error LNK1104: cannot open file "Debug/1230120.exe"
&Ouml;&acute;&ETH;&ETH; link.exe &Ecirc;±&sup3;&ouml;&acute;í.

1230120.exe - 1 error(s), 0 warning(s)
2012-12-23 21:30
haoxianwen
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2012-12-22
收藏
得分:0 
回复 4楼 C_戴忠意
不行啊 ……
2012-12-23 21:31
快速回复:一份课程设计 编译没有错 调试出现link。exe错误求助
数据加载中...
 
   



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

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