| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1589 人关注过本帖
标题:很滑稽的通讯录 不信你玩玩试试 我也不知道错哪了 痛苦啊···求大神 大虾 ...
只看楼主 加入收藏
Ken_Wong
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2013-5-18
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:17 
很滑稽的通讯录 不信你玩玩试试 我也不知道错哪了 痛苦啊···求大神 大虾···
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
//以上为头文件;

//以下为创建联系人结构体(数组);
struct Person
{
       char name[20];
       char num[20];
       char address[30];
       char remark[100];
}Person[100];
//以上为创建联系人结构体(数组);

void menu();//菜单函数声明;  
void create();//新建联系人函数声明;
void modify();//修改联系人函数声明;
void deleter();//删除联系人函数声明;
void traverse();//遍历联系人函数声明;
void sort(struct Person *);//排序函数声明;(注:排序功能镶嵌到遍历联系人中;)
void search();//查找联系人函数声明;

int record=0;//用于记录联系人的记数,该为程序的核心;




 
//以下为主函数体;
int main()
{
    menu();

    return 0;
}
//以上为主函数体;





//以下为菜单功能函数部分;
void menu()
{
     int n;
  printf("\n");
  printf("\n");
  printf("\t\t       ^.^         欢迎使用通讯录系统       ^.^      \n\n\n");
  printf("\n");
  
  printf("\t\t*********************** 操作菜单 *******************\n\n");
  printf("\t\t*                  1.  添加联系人                  *\n\n");
  printf("\t\t*                  2.  修改联系人                  *\n\n");
  printf("\t\t*                  3.  删除联系人                  *\n\n");
  printf("\t\t*                  4.  全部联系人                  *\n\n");
  printf("\t\t*                  5.  查找联系人                  *\n\n");
  printf("\t\t*                  6.  退                        *\n\n");
  printf("\t\t*********制作人************************黄梓健*******\n\n");

  printf("请选择操作种类(1-6) \n (按Enter进行确认) : ");
  scanf("%d",&n);
  
  switch(n)//分支实现操作功能;
  {
      case 1: create(); break;
      case 2: modify(); break;
      case 3: deleter(); break;
      case 4: traverse(); break;
      case 5: search(); break;
      case 6: {system("cls");printf("\n\n\n\n\t\t\t");
              printf("······感谢您的使用 再见·······\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t\t\t");
              exit(0);}  
      default:                    //输入无义后的处理办法;
    {   
        printf("\n\n\n\t\t输入有误!请重新输入(自动跳转恢复中···)\n\n\n\n\n\t\t\t");
        printf("\t\t\t");
        getchar();
        system("cls");
        menu();
    }
  }
}
//以上为菜单功能函数部分;


//以下为新建联系人函数部分;
void create()
{
    FILE *fp;
    int want;//想要保存的联系人个数;
    int i;
    char j;

    system("cls");//清屏;

    printf("\t^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ \n\n");
    printf("\t^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ \n\n");
    printf("\t^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ \n\n");
    printf("\n\n\n\t\t********       确定添加联系人?(y/n)  ********\n\n\n");
    printf("\t(若确定请输入指令'y',否则按其他键返回主菜单:)");

    getchar();   
    j=getchar();//j接收键盘的输入;

    if(j!='y')
        {system("cls");
        menu();}

    else
  {
            system("cls");
               
            fp=fopen("contactBook","wb+"); //“打开”通讯录文件;

            printf("\n\n\n\t已建有通讯录文件'contactBook'  联系人均存储在该通讯录文件中···\n");  

//KEY
                    for(i=1;i<=100;i++)
                            {fread(&Person[i],sizeof(struct Person),1,fp);}//从文件中读取全部联系人信息;

                    for(i=1;i<=100;i++)
                            {
                            if (Person[i].name==NULL)//若发现有空结构体,下一步···
                            {record=i-1;break;} //令record等于i,由于i由1开始记数,所以此时记录record=i-1
                            //跳出本次循环;
                            }
//KEY
            
            
            
            printf("\n\t\n\n\n\t\t\t");
            system("pause");
            system("cls");
               

            printf("\n\n\n\n\n\n\n\n\n\n\t\t\t想保存的联系人个数(1-100):");
            scanf("%d",&want);
            printf("\n");
            
            
            if(want<1||want>100)
            {
             printf("请输入正确的欲保存联系人个数!\n");
             printf("********************************\n");
             printf("******重新载入中***请稍等*******\n");
             system("pause");
             menu();//不正常输入want则返回主菜单;
            }
            

             //正常输入want后执行下面部分;
             else

             {          system("cls");
                        printf("\t\t\t");
                        printf("\n\t\t\t********正在新建%d位联系人********\n",want);
                        printf("\n");
               
                        for(i=1;i<=want;i++)//循环存储联系人信息;                    
                    {                       
                        printf("\t\t\t*正在新建第%d个联系人 还有%d个待建*\n",i,want-i);

                        record++;//编号自增; (初始默认是0,但若已存在通讯录文件则有改变。注:结构体由Person[1]开始存储联系人信息)
                    
                        printf("\t请输入联系人姓名:\n");printf("\t\t");
                        scanf("%s",&Person[record].name);
                        
                        printf("\t请输入联系人号码:\n");printf("\t\t");
                        scanf("%s",&Person[record].num);
                        
                        printf("\t请输入联系人地址:\n");printf("\t\t");
                        scanf("%s",&Person[record].address);
                        
                        printf("\t请输入该联系人备注:\n");printf("\t\t");
                        scanf("%s",&Person[record].remark);
                        
                        fwrite(&Person[record],sizeof(struct Person),1,fp);//把当前结构体写入二进制文件中;
                         printf("***************************************");
                        printf("***************************************\n\n");

                     }
              }   

                        printf("\t\t\t\t正在创建中 请稍后···");
                        printf("\n\n\n\n\t\t\t\t");
                        system("pause");

                //以下为重现录入情况;
                system("cls");
                printf("以下为刚录入的联系人:\n");
               
               for(i=record-want+1;i<=record;i++)
               {
                printf("****************************************\n");
                printf("*                                     **\n");           
                printf("**     联系人姓名:");printf("%s",Person[i].name);
                printf("\n");
                printf("*                                     **\n");
                printf("**     联系人号码:");printf("%s",Person[i].num);
                printf("\n");
                printf("*                                     **\n");
                printf("**     联系人地址:");printf("%s",Person[i].address);
                printf("\n");
                printf("*                                     **\n");
                printf("**     联系人备注:");printf("%s",Person[i].remark);
                printf("\n");
                printf("*                                     **\n");
                printf("****************************************\n");
                printf("\n");
               }
                printf("\n        ^.^     保存成功       ^.^       \n");
                printf("**************刚录入%d条记录*************\n",want);
                printf("**************共有%d条记录***************",record);
                //以上为重现录入情况;
                    
            printf("\n");
            printf("\n");
            printf("\n");
            printf("\n");
            printf("*^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^*\n");
            printf("*   ^.^      按任意键返回菜单     ^.^   *\n");
            printf("*^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^ ^.^*\n");
            printf("\n");            
            
            fclose(fp);//关闭文件指针;   
            system("pause");
            system("cls");
            menu();                                          
       }
   
}
//以上为新建联系人函数部分;


 
//以下为修改联系人函数部分;
void modify()
{
    int i;
    FILE *fp;
    char gname[20];//名字改正;
    char gnum[20];//号码改正;
    char gaddress[30];//号码改正;
    char gremark[100];//备注改正;

    system("cls");//清屏;

    printf("\n\n\n\t请输入你想进行修改的联系人姓名(输入'exit'为返回主菜单):");
    scanf("%s",gname);

    if( strcmp(gname,"exit")==0 )
    {system("cls");
        menu();}
    else
{
   
   
    if ((fp=fopen("contactBook","rb+"))==NULL)
    { printf("\n\n\t||=.=   没有联系人记录···按任意键返回菜单··· =.=||  \n\n\t\t\t");
    system("pause");
    system("cls");
    menu(); }
            
    else
 {  
//KEY
                    for(i=1;i<=100;i++)
                            {fread(&Person[i],sizeof(struct Person),1,fp);}//从文件中读取全部联系人信息;

                    for(i=1;i<=100;i++)
                            {
                            if (Person[i].name==NULL)//若发现有空结构体,下一步···
                            {record=i-1;break;} //令record等于i,由于i由1开始记数,所以此时记录record=i-1
                            //跳出本次循环;
                            }
//KEY

    for(i=1;i<=record;i++)
      {
        if((strcmp(Person[i].name,gname))==0)
        {
                printf("\t\t\t     ^.^     找到相关联系人如下:  ^.^  \n");
                printf("****************************************\n");
                printf("****************************************\n");
                printf("*                                     **\n");           
                printf("**     联系人姓名:");printf("%s",Person[i].name);
                printf("\n");
                printf("*                                     **\n");
                printf("**     联系人号码:");printf("%s",Person[i].num);
                printf("\n");
                printf("*                                     **\n");
                printf("**     联系人地址:");printf("%s",Person[i].address);
                printf("\n");
                printf("*                                     **\n");
                printf("**     联系人备注:");printf("%s",Person[i].remark);
                printf("\n");
                printf("*                                     **\n");
                printf("****************************************\n");
                printf("****************************************\n");
                printf("\n");
 
                printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
                printf("$$$修改联系人姓名---请在下面输入新的联系人姓名(不需修改请输入ok)\n");
                printf("原联系人姓名:%s\n",Person[i].name);
                printf("新联系人姓名:");
                scanf("%s",gname);
                if( strcmp(gname,"ok")!=0)
                {strcpy(Person[i].name,gname);}
                else
                {printf("\n保持原联系人姓名^.^ \n\n");}
               
                printf("$$$修改联系人号码---请在下面输入新的联系人号码(不需修改请输入ok)\n");
                printf("原联系人号码:%s\n",Person[i].num);
                printf("新联系人号码:");
                scanf("%s",gnum);
                if( strcmp(gnum,"ok")!=0)
                {strcpy(Person[i].num,gnum);}
                else
                {printf("\n保持原联系人号码^.^ \n\n");}
               
                printf("$$$修改联系人地址---请在下面输入新的联系人地址(不需修改请输入ok)\n");
                printf("原联系人地址:%s\n",Person[i].address);
                printf("新联系人地址:");
                scanf("%s",gaddress);
                if( strcmp(gaddress,"ok")!=0)
                {strcpy(Person[i].address,gaddress);}
                else
                {printf("\n保持原联系人地址^.^ \n\n");}
               
                printf("$$$修改联系人备注---请在下面输入新的联系人备注(不需修改请输入ok)\n");
                printf("原联系人备注:%s\n",Person[i].remark);
                printf("新联系人备注:");
                scanf("%s",gremark);
                if( strcmp(gremark,"ok")!=0)
                {strcpy(Person[i].remark,gremark);}
                else
                {printf("\n保持原联系人备注^.^ \n\n");}
                printf("\n");
                printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
               
                printf("$$$$$$$$$$ 以下为修改后的联系人 $$$$$$$$$$\n");
                printf("****************************************\n");
                printf("****************************************\n");
                printf("*                                     **\n");           
                printf("**     联系人姓名:");printf("%s",Person[i].name);
                printf("\n");
                printf("*                                     **\n");
                printf("**     联系人号码:");printf("%s",Person[i].num);
                printf("\n");
                printf("*                                     **\n");
                printf("**     联系人地址:");printf("%s",Person[i].address);
                printf("\n");
                printf("*                                     **\n");
                printf("**     联系人备注:");printf("%s",Person[i].remark);
                printf("\n");
                printf("*                                     **\n");
                printf("****************************************\n");
                printf("****************************************\n");
                printf("\n");
        
        break;
        }
        
        
        else if(i==record)
        {
             printf("\n   =.=      没有相关联系人信息      =.=    \n");
             printf("······按任意键返回主菜单······\n\n");
             system("pause");
             system("cls");//清屏
             menu();
        }
       }
    fclose(fp);
   
    fp=fopen("contactBook","wb+");
    for(i=1;i<=record;i++)
      {
        fwrite(&Person[i],sizeof(struct Person),1,fp);//重写通讯录文件;
      }
    fclose(fp);
   
    printf("      *^.^*    联系人已修改成功!    *^.^*     ");
    printf("\n······ 按任意键返回主菜单 ······\n");
    system("pause");
    system("cls");
    menu();
 }

}
}
//以上修改联系人函数部分;



//以下为删除联系人函数部分;
void deleter()
{
    FILE *fp;
    int i,j;
    char q;
    char s[20];//s代表删除^.^

    system("cls");//清屏;

    printf("\n\n\n\t请输入你想删除的联系人姓名(输入'exit'为返回主菜单):");
    scanf("%s",s);
   
    if( strcmp(s,"exit")==0 )
    {system("cls");
        menu();}
    else
{

   
     if((fp=fopen("contactBook","rb+"))==NULL)
     {
     printf("\n\n\t\t  ||=.=    没有联系人信息···   =.=||  \n\n\n");
     printf("\t\t  ······按任意键返回菜单······\n\n\n\n");
     printf("\t\t\t\t\t\t\t");
     system("pause");
     system("cls");//清屏;
     menu(); //回到菜单状态;
     }
     
     else
     {
//KEY
                    for(i=1;i<=100;i++)
                            {fread(&Person[i],sizeof(struct Person),1,fp);}//从文件中读取全部联系人信息;

                    for(i=1;i<=100;i++)
                            {
                            if (Person[i].name==NULL)//若发现有空结构体,下一步···
                            {record=i-1;break;} //令record等于i,由于i由1开始记数,所以此时记录record=i-1
                             //跳出本次循环;
                            }
                    
//KEY

        
         
         for(i=1;i<=record;i++)
         {
            if(strcmp(Person[i].name,s)==0)//一旦匹配,就立即输出!
            {
                printf("\t找到相关联系人如下  *^.^*\n");
                printf("****************************************\n");
                printf("****************************************\n");
                printf("*                                     **\n");           
                printf("**     联系人姓名:");printf("%s",Person[i].name);
                printf("\n");
                printf("*                                     **\n");
                printf("**     联系人号码:");printf("%s",Person[i].num);
                printf("\n");
                printf("*                                     **\n");
                printf("**     联系人地址:");printf("%s",Person[i].address);
                printf("\n");
                printf("*                                     **\n");
                printf("**     联系人备注:");printf("%s",Person[i].remark);
                printf("\n");
                printf("*                                     **\n");
                printf("****************************************\n");
                printf("****************************************\n");
                printf("\n");
                //break;//找到后 立即跳出for循环;


                printf("\n确认删除???(确认请按'y',否则按任意键返回主菜单···)\n");
                getchar();
                q=getchar();

                  if( q!='y' )
                {system("cls");
                      menu();}
               
                  else
                {
                    for(j=i+1;j<=record;j++)
                {strcpy(Person[j-1].name,Person[j].name);
                strcpy(Person[j-1].num,Person[j].num);
                strcpy(Person[j-1].address,Person[j].address);
                strcpy(Person[j-1].remark,Person[j].remark);}//删除原理:利用后者完全覆盖前者;
               
                record--;//每删除一个联系人,变量record记录减少一次;     
                fclose(fp);
               
                fp=fopen("contactBook","wb+");
                for(i=1;i<=record;i++)
                  {
                    fwrite(&Person[i],sizeof(struct Person),1,fp);//重写通讯录文件;
                  }
                fclose(fp);
               
                printf("\n\n\t\t      *^.^*    联系人已成功删除!    *^.^*     \n");
                printf("\n\t\t······ 按任意键返回主菜单 ······\n\n\n\n\t\t");
                system("pause");
                system("cls");
                menu();
                }
            }
            
               
              else if(i==record)//找不到就执行下面;
              {  
                 printf("\n\n\t\t  ||=.=    没有找到该联系人信息···   =.=||  \n\n\n");
                 printf("\t\t  ······按任意键返回菜单······\n\n\n\n");
                 printf("\t\t\t\t\t\t\t");
                 system("pause");
                 system("cls");//清屏;
                 menu(); //回到菜单状态;
              }
           }
     }  
     printf("\n\t\t···按任意键返回主菜单···");
     system("pause");
     system("cls");
     menu();
}
}
//以上为删除联系人函数部分;  



//以下为遍历联系人函数部分;
void traverse()
{
     char g;
     int i;//for专用;
     FILE *fp;

     system("cls");//清屏,进入显示所有联系人的界面;     
   
     fp=fopen("contactBook","rb+");
     
     if((fp=fopen("contactBook","rb+"))==NULL)
     {
     printf("\n\n\n\n\n\t\t=.= 没有联系人记录 或者保存的文件丢失 =.=   \n\n");
     printf("\t········按任意键回到菜单·········\n\n\n");
     printf("\t\t\t");
     system("pause");
     system("cls");//清屏;
     menu(); //回到菜单状态;
     }
     
     else
     {
//KEY
                    for(i=1;i<=100;i++)
                            {fread(&Person[i],sizeof(struct Person),1,fp);}//从文件中读取全部联系人信息;

                    for(i=1;i<=100;i++)
                            {
                            if (Person[i].name==NULL)//若发现有空结构体,下一步···
                            {record=i-1;break;} //令record等于i,由于i由1开始记数,所以此时记录record=i-1
                             //跳出本次循环;
                            }
//KEY
             printf("以下为全部联系人信息:\n");
                 for(i=1;i<=record;i++)
               {
                     printf( "( %d )",i);
                printf("***********************************\n");
                printf("****************************************\n");
                printf("*                                     **\n");           
                printf("**     联系人姓名:");printf("%s",Person[i].name);
                printf("\n");
                printf("*                                     **\n");
                printf("**     联系人号码:");printf("%s",Person[i].num);
                printf("\n");
                printf("*                                     **\n");
                printf("**     联系人地址:");printf("%s",Person[i].address);
                printf("\n");
                printf("*                                     **\n");
                printf("**     联系人备注:");printf("%s",Person[i].remark);
                printf("\n");
                printf("*                                     **\n");
                printf("****************************************\n");
                printf("****************************************\n");
                printf("\n");
               }
                 printf("\n");printf("\t共%d条记录\n",record);

                 printf("\t\t\t\t\t*^.^*");               
               
         
         printf("\n");
         printf("***************************************");
         printf("*****************************************\n");
         
         
         printf("\t^.^       需要进行排序查看吗?(y/n)\n\t\t(输入‘y’进行排序,输入其他键返回主菜单:)");
         
         getchar();
         g=getchar();
         
         if(g!='y')
         {
             fclose(fp);
             system("cls");
             menu();
         }
         
         else
             { system("cls");//清屏,以便显示排序后的全部联系人;

               sort(Person);//调用排序函数;

               printf("\n");
               printf("\n");
              
               fclose(fp);

               printf("              按任意键返回主菜单···");
               system("pause");//间歇···
               system("cls");
               menu();
             }
       }
}
     
//以上为遍历联系人函数部分;



//以下为排序函数部分;
void sort(struct Person *a)
{
     int i,j;//for循环,冒泡法排序···
     char m;
     char n;
     struct Person temp;
   
     for(j=1;j<=record;j++)
         for(i=1;i<=record-j;i++)//冒泡中···
     {
     m=Person[i].name[0] ;//只接收首字母;
     n=Person[i+1].name[0];//只接收首字母;
         if (m>n)
         {temp=Person[i];
         Person[i]=Person[i+1];
         Person[i+1]=temp;}//很明显,交换中···
     }

     printf("以下为排序后的全部联系人信息:\n");
               for(i=1;i<=record;i++)
               {printf("( %d )\n",i);
                printf("****************************************\n");
                printf("****************************************\n");
                printf("*                                     **\n");           
                printf("**     联系人姓名:");printf("%s",Person[i].name);
                printf("\n");
                printf("*                                     **\n");
                printf("**     联系人号码:");printf("%s",Person[i].num);
                printf("\n");
                printf("*                                     **\n");
                printf("**     联系人地址:");printf("%s",Person[i].address);
                printf("\n");
                printf("*                                     **\n");
                printf("**     联系人备注:");printf("%s",Person[i].remark);
                printf("\n");
                printf("*                                     **\n");
                printf("****************************************\n");
                printf("****************************************\n");
                printf("\n");
               }
     printf("\n");
     printf("\t*******************排序完成*********************");
     
     return;
}
//以上为排序函数部分;



//以下为查找联系人函数部分;
void search()
{
     char findname[20];
     int i;//for专用···
     FILE *fp;

     int k;

     system("cls");//清屏;
     
     printf("\n\n\t^.^请输入你想查找的联系人姓名(输入'exit'为返回主菜单) ^.^  \n");
     printf("        我要查找:");
     scanf("%s",findname);

     if( strcmp(findname,"exit")==0 )
     {   system("cls");
         menu();}
     else
{

     printf("\n");
     

     if((fp=fopen("contactBook","rb+"))==NULL)
     {
     printf("\n\n\t\t  ||=.=    没有联系人信息···   =.=||  \n\n\n");
     printf("\t\t  ······按任意键返回菜单······\n\n\n\n");
     printf("\t\t\t\t\t\t\t");
     system("pause");
     system("cls");//清屏;
     menu(); //回到菜单状态;
     }
     
     else
     {
//KEY
                    for(i=1;i<=100;i++)
                            {fread(&Person[i],sizeof(struct Person),1,fp);}//从文件中读取全部联系人信息;

                    for(i=1;i<=100;i++)
                    {
                            if (Person[i].name==NULL)//若发现有空结构体,下一步···
                            {record=i-1;break;} //令record等于i,由于i由1开始记数,所以此时记录record=i-1
                             //跳出本次循环;
                    }
                    
//KEY

        
         
         for(i=1;i<=record;i++)
         {
            if(strcmp(Person[i].name,findname)==0)//一旦匹配,就立即输出!
            {
                printf("\t找到了!!!  *^.^*\n");
                printf("****************************************\n");
                printf("****************************************\n");
                printf("*                                     **\n");           
                printf("**     联系人姓名:");printf("%s",Person[i].name);
                printf("\n");
                printf("*                                     **\n");
                printf("**     联系人号码:");printf("%s",Person[i].num);
                printf("\n");
                printf("*                                     **\n");
                printf("**     联系人地址:");printf("%s",Person[i].address);
                printf("\n");
                printf("*                                     **\n");
                printf("**     联系人备注:");printf("%s",Person[i].remark);
                printf("\n");
                printf("*                                     **\n");
                printf("****************************************\n");
                printf("****************************************\n");
                printf("\n");
                break;//找到后 立即跳出for循环;   
            }

        
            
               
              else if(i==record)//找不到就执行下面;
              {  
                 printf("\n\n\t\t  ||=.=    没有找到该联系人信息···   =.=||  \n\n\n");
                 printf("\t\t  ······按任意键返回菜单······\n\n\n\n");
                 printf("\t\t\t\t\t\t\t");
                 system("pause");
                 system("cls");//清屏;
                 menu(); //回到菜单状态;
              }
           }
     }  
     printf("\n\t\t···按任意键返回主菜单···");
     system("pause");
     system("cls");
     menu();  
}
}
//以上为查找联系人函数部分;
搜索更多相关主题的帖子: void 函数 address include 联系人 
2013-05-18 11:22
没事学学
Rank: 2
等 级:论坛游民
帖 子:77
专家分:46
注 册:2013-3-28
收藏
得分:3 
这么长 吓死了快
2013-05-18 14:57
Han_FlyB
Rank: 6Rank: 6
等 级:侠之大者
帖 子:143
专家分:424
注 册:2013-3-25
收藏
得分:3 
这么长,已经是高手啦
2013-05-18 15:46
shaosuqiang
Rank: 2
等 级:论坛游民
帖 子:17
专家分:12
注 册:2013-5-5
收藏
得分:3 
有错误么?运行了下,感觉功能都可以实现!
2013-05-18 16:00
我叫沃恩
Rank: 12Rank: 12Rank: 12
来 自:Asia
等 级:贵宾
威 望:10
帖 子:1234
专家分:3865
注 册:2013-3-29
收藏
得分:3 
你已经很牛了!!自己好好看看吧!爱莫能助!

因为我是菜鸟,所以应该被骂! 细节+坚持=成功!
2013-05-18 22:09
雪狼MJ
Rank: 8Rank: 8
来 自:甘肃
等 级:蝙蝠侠
威 望:4
帖 子:267
专家分:853
注 册:2012-5-27
收藏
得分:3 
简单测试了下,功能都可以实现。还不错,就是。。。。。。。。。。。拜托不要随便卖萌,有怪蜀黍的嫌疑!

给楼主个建议,把程序写成多文件的形式,对某些函数进行分离,那样的话更容易测试,也能更快的定位错误。

Edsger Dijkstra:算法+数据结构=程序
2013-05-18 22:55
Ken_Wong
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2013-5-18
收藏
得分:0 
回复 4楼 shaosuqiang
你真的运行不出错误吗???其实这是我的大作业,相信老师也只会运行一次···但是,这个程序也只能运行一次才看不出端倪···运行第二次,你就会发现···哈哈哈···
2013-05-19 10:38
Ken_Wong
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2013-5-18
收藏
得分:0 
回复 6楼 雪狼MJ
我用的是DevCPP编译 所以格式方面···不如VC6.0好···现在我已经换了VC6.0了···
2013-05-19 10:39
Ken_Wong
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2013-5-18
收藏
得分:0 
回复 3楼 Han_FlyB
这是我第一次编程···我是大大的菜鸟···真的···
2013-05-19 10:40
Ken_Wong
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2013-5-18
收藏
得分:0 
回复 5楼 我叫沃恩
我终于知道错哪了···新建联系人一定要和添加联系人区别开 不然原来已经有了的文件会被覆盖掉~!还有一点,就是找record的时候(两个//KEY中间的),不应该是“    Person[i].name==NULL    ”,而应该是“    Person[i].name[0]=='\0'   ”,这个区别大得很啊~~~!这就是为什么我的程序只能运行一次的原因,第二次开始,基本上全错···
2013-05-19 10:47
快速回复:很滑稽的通讯录 不信你玩玩试试 我也不知道错哪了 痛苦啊···求大神 ...
数据加载中...
 
   



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

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