home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / tutorial / cpptutor / source / phrase.inl < prev    next >
Encoding:
Text File  |  1994-05-15  |  707 b   |  37 lines

  1.                                // Chapter 6 - Program 12 - PHRASE.INL
  2.  
  3. #include "string.h"
  4.  
  5. char phrase::full_phrase[25];
  6.                               
  7. inline phrase::phrase(void)
  8. {
  9.    strcpy(noun, "");
  10.    strcpy(verb, "");
  11.    strcpy(full_phrase, "(No text yet)");
  12. }
  13.  
  14. inline void phrase::set_noun(char *in_noun)
  15. {
  16.    strcpy(noun, in_noun);
  17. }
  18.  
  19. inline void phrase::set_verb(char *in_verb)
  20. {
  21.    strcpy(verb, in_verb);
  22. }
  23.  
  24. inline char *phrase::get_phrase(void)
  25. {
  26.    strcpy(full_phrase, verb);
  27.    strcat(full_phrase, " the ");
  28.    strcat(full_phrase, noun);
  29.    return full_phrase;
  30. }
  31.  
  32.  
  33.  
  34. // Result of execution
  35. //
  36. // (This file cannot be executed)
  37.