| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 473 人关注过本帖
标题:一份课程设计 编译没有错 调试出现link。exe错误求助
只看楼主 加入收藏
haoxianwen
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2012-12-22
结帖率:0
收藏
已结贴  问题点数:20 回复次数:5 
一份课程设计 编译没有错 调试出现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
yudeyinji198
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:139
专家分:133
注 册:2012-8-30
收藏
得分:7 
截个图看看嘛。。
2012-12-22 23:00
pauljames
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
等 级:千里冰封
威 望:9
帖 子:1555
专家分:10000
注 册:2011-5-8
收藏
得分:7 
是不是哪个库函数没找到?

经常不在线不能及时回复短消息,如有c/单片机/运动控制/数据采集等方面的项目难题可加qq1921826084。
2012-12-23 16:42
C_戴忠意
Rank: 9Rank: 9Rank: 9
等 级:蜘蛛侠
威 望:2
帖 子:575
专家分:1349
注 册:2011-10-21
收藏
得分:7 
你看看进程里有没有你的那个程序在运行,有的话关掉它就行。或者改个名字。

编程之路定要走完……
2012-12-23 18:47
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.026151 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved