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
Need help in network programming in C++ project. How much you charge?

Operators in C++: All C operators are valid operators in C++ also.  Besides C++ has developed some new operators like Operators and their Expression: 1.      Logical op

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Is it possible to create your own header files? - Yes, it's possible to create a customized header file. - To do this, you just need to include function prototypes that you

Project Description: I will need a tutor that would help me out in Data Structure and learning Algorithm more at the mathematical/algorithmic level. The book is written by "by T

I need Cryengine Sandbox Speedometer and Tachometer We want to get working Tachometer and Speedometer for a car in latest Cryengine Sandbox. You will find how to make it usin

redirection in c++

Explain the Macros? Preprocessor' is a translation stage that is applied to your source code before the compiler proper gets its hands on it. Usually the preprocessor performs

#question.Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two po

Receive 3 numbers and display them in ascending order from smallest to largest ed#