C电子词典设计
各位CDSN社区里面的成员大家好!我是一个刚刚注册进来的FISH 其实 我也是一个计算机专业的在读大学生 由于最近学校有要求关于C语言的课题设计题目 小弟才疏学浅 学艺不精 于是特来CDSN社区讨教 希望能够得到那位好心的大侠 拔刀相助啊 指点江山啊~~~当面重谢不敢说 不过肯定会十分的感谢你 也十分感谢CDSN社区这个中国最大的 网络社区 同时也希望CDSN社区能够办的越来越好~~
以下为课题题目:
功能要求:
制作一个电子词典:可以输入 查询 删除 修改词条(英文单词 中文或英文解释).
界面要求:
美观简洁.
其实我也已经在 百度 上面找到了一个相关的 源代码附带如下:
#include "stdafx.h"
#include <windows.h>
#include <stdio.h>
#include <malloc.h>
#include <winbase.h>
#include <process.h>
void Search()
{
char temp[100];
char buffer[2];
char result[100];
printf("Please input the word you want:\n");
scanf("%s",&temp);
buffer[0]=temp[0];
buffer[1]='\0';
int ret=GetPrivateProfileString(buffer,temp,0,result,100,"./date.ini");
if(ret>0)
printf("%s\n\n\n\n\n",result);
else
printf("Sorry there is not what you want.\n\n\n\n\n");
}
void InsertItem()
{
char temp[100];
char buffer[2];
char result[100];
printf("Inser the word:\n");
scanf("%s",&temp);
printf("Givinig the meaning:\n");
getchar();
scanf("%s",&result);
buffer[0]=temp[0];
buffer[1]='\0';
int ret=WritePrivateProfileString(buffer,temp,result,"./date.ini");
if(ret=0)
printf("Inser fail。\n\n\n\n\n");
else
printf("Inser success。\n\n\n\n\n");
}
int main(int argc, char* argv[])
{
int index;
main:
printf("**************MENU***************\n\n");
printf(" 1 Chinese to English\n");
// printf("2 English to Chinese\n");
printf(" 2 Inser the new word\n");
// printf(" 3 Del the existed word \n");
printf(" 3 Clean the screen\n");
printf(" 4 Exit\n\n");
printf("**********************************\n");
do{
printf("Please chioce form 1 to 4(1~4):\n");
scanf("%d",&index);
}while(index<0||index>5);
switch(index)
{
case 1:
Search();
goto main;
break;
case 2:
InsertItem();
goto main;
break;
case 3:
system("cls");
goto main;
break;
case 4:
return 0;
break;
default:
break;
}
return 0;
}
小弟使用的 是TC++3.0集成环境 由于上面源代码是 用VC++编写出来的 头文件 #include "stdafx.h" 总是显示 找不到我也找了相关的帖子看过的可还是得不到好的解决 ;删除#include "stdafx.h" 之后 又是显示 #include <windows.h> #include <winbase.h> 找不到 实在是不知道该怎么办了 于是才想到了到CSDN上面来求救 希望那位好心人能够帮我看看啊 绝对不耽误你们超过10分钟的时间撒 因为我知道CDSN上面的都是高手
有意相助的可联系我QQ:317817274 或者我 邮箱:xc0910@163.com
再次拜谢啊!!