文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>C语言实例52:读写字符串

C语言实例52:读写字符串

时间:2010-07-02  来源:hnrainll

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>

char *dic[][40] = {"luster","A bright shine on the surface.",
        "disgrase", "Loss of honor and respect.",
        "glamour","Strong attraction.",
        "tomb","The place where a dead person is buried.",
        "garbage","Unwanted or spoiled food.",
        "bliss", "Great happiness of joy.",
    "commend","Speak favorably list.",
        "",""
};

int main(int argc, char *argv[])
{
    char word[80], ch;
    char **point;

    do{
        puts("Please enter word:");
        scanf("%s", word);

        point = (char **)dic;
        do{
            if(!strcmp(*point, word))
            {
                puts("The meaning of the word is:");
                puts(*(point+1));
                break;
            }
            if(!strcmp(*point, word))
                break;
            point = point + 2;
        }while(*point);
        if(!*point)
        puts("The word is not in dictionary.");
        printf("Another? (y/n):");
        scanf("%c%*c",&ch);
    }while(toupper(ch) != 'N');


    system("pause");
    return 0;
}


相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载