home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
OTHERUTI
/
TCPP30-3.ZIP
/
EXAMPLES.ZIP
/
DEF.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1992-02-18
|
687b
|
31 lines
// Borland C++ - (C) Copyright 1991 by Borland International
// def.cpp: Implementation of the Definition class
// from Hands-on C++
#include <string.h>
#include "def.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; // line 27
}