home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD2.mdf
/
c
/
tcpp
/
examples
/
def2.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1990-06-09
|
564b
|
29 lines
// def.cpp: Implementierung einer Definitionsklasse
#include <string.h>
#include "def2.h"
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;
}