home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l440 / 2.ddi / CHAP6 / TEST2E.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-01-24  |  706 b   |  31 lines

  1. /* 
  2. TEST2E.C 
  3. Turbo C++ 2.0:
  4.     tcc test2e.c send2e.c do2e.asm have2e.asm   
  5. Microsoft C 6.0:
  6.     cl -qc test2e.c send2e.c -MAmx do2e.asm have2e.asm
  7.     
  8. SORRY, THE CL COMMAND-LINE IN PRINTED VERSION WAS WRONG: SHOULD BE
  9. SEND2E.C (AS ABOVE), NOT SEND2E.ASM!
  10. */
  11.  
  12. #include <stdlib.h>
  13. #include <stdio.h>
  14. #include <string.h>
  15.  
  16. main()
  17. {
  18.     char buf[80];
  19.     for (;;)
  20.     {
  21.         fputs("$ ", stdout);
  22.         gets(buf);
  23.         // differs from printed version: accept EXIT too!
  24.         if ((strcmp(buf, "bye") == 0 || strcmp(buf, "BYE") == 0) ||
  25.             (strcmp(buf, "exit") == 0 || strcmp(buf, "EXIT") == 0))
  26.             break;
  27.         Send2E(buf);
  28.     }
  29.     puts("Bye");
  30. }
  31.