Implementation of the dictionary class, C/C++ Programming

Implementation of the Dictionary class:

int Dictionary::find_word(char *s)


   char word[81];

   for (int i = 0; i < nwords; ++i)

      if (stricmp(words[i].get_word(word),s) == 0)

         return i;


   return -1;



void Dictionary::add_def(char *word, char **def)


   if (nwords < Maxwords)



      while (*def != 0)






int Dictionary::get_def(char *word, char **def)


   char meaning[81];

   int nw = 0;

   int word_idx = find_word(word);

   if (word_idx >= 0)


      while (words[word_idx].get_meaning(nw,meaning) != 0)


         def[nw] = new char[strlen(meaning)+1];



      def[nw] = 0;



   return nw;



Posted Date: 10/18/2012 6:44:20 AM | Location : United States

Related Discussions:- Implementation of the dictionary class, Assignment Help, Ask Question on Implementation of the dictionary class, Get Answer, Expert's Help, Implementation of the dictionary class Discussions

Write discussion on Implementation of the dictionary class
Your posts are moderated
Related Questions
Explain about the strategies of implementation of the statecharts, Database Management System?

to find prime numbers upto any number say "n" entered by user

Write three functions in C or C++: one that declares a large array statically, one that declares the same large array on the stack, and one that creates the same large array from t

Design a game in c: const DODGERS = 0; const GIANTS = 1;   void main(void) {    int scoreboard [2][9];    // An array two rows by nine columns    int team, i

write a program to find the area under the curve y=f(x) between x=a and x=b integrate y=f(x)   #include float start_point, /* GLOBAL VARIABLES */

Expected output of the program: 1. Consider the following programs. For each, indicate whether the program is correct. If yes, what is the expected output? If not, what is the

Question: (a) Explain a linked list. (b) Describe the three different types of linked list with the help of diagrams. (c) Give two advantages and two disadvantages

I need Decompile Library(.DLL or .SO) into source code Project Description: I am seeking an experienced programmer or anyone who knows a thing or two about reverse engineerin

Enumerated Constants Enumerated constants enable the creation of new types and then explain variables of these types so that their values are restricted to a set of possible va