Implementation of the definition class - c++ program, C/C++ Programming

Implementation of the Definition class:

void Definition::put_word(char *s)

{

   word = new char[strlen(s)+1];

   strcpy(word,s);

   nmeanings = 0;

}

 

void Definition::add_meaning(char *s)

{

   if (nmeanings < Maxmeans)

   {

      meanings[nmeanings] = new char[strlen(s)+1];

      strcpy(meanings[nmeanings++],s);

   }

}

 

char * Definition::get_meaning(int level, char *s)

{

   if (0 <= level && level < nmeanings)

      return strcpy(s,meanings[level]);

   else

      return 0;                                // line 27

}

Posted Date: 10/18/2012 6:42:36 AM | Location : United States







Related Discussions:- Implementation of the definition class - c++ program, Assignment Help, Ask Question on Implementation of the definition class - c++ program, Get Answer, Expert's Help, Implementation of the definition class - c++ program Discussions

Write discussion on Implementation of the definition class - c++ program
Your posts are moderated
Related Questions
draw the flow chart to print the fibonacci series upto n th terms

write a c++ program, that finds the minimum total number of shelves, including the initial one, required for this loading process.

Define hash functions. Explain the Division method, Mid square method and Folding method of hash functions.

how to create the programs in c++ knowledge

Project Description: I need to convert AFL code of Amibroker to DLL plugin to hide original formula, and also to protect the DLL and making it hardware locked. I need to wrap th

#question.gsdjfhjhjfkfk.

write a program to find the minimum number of shelves

Define Register Storage Class - computer programming? The Storage class register notify the compiler that the associated variables must be stored in high-speed memory register.

What if I wish a local to "die" before the close} of the scope wherein it was created? Can I call a destructor on a local if I want to?

Op e r a t o r O v e r l o a d i n g : W h e n   a n   o p e r a t o r   i s   u s e d   f o r   d i ff e r e n t   op e r a