Category : C Source Code
Archive   : C-TUTOR.ZIP
Filename : BETTERIN.C

 
Output of file : BETTERIN.C contained in archive : C-TUTOR.ZIP
/* Chapter 9 - Program 3 */
#include "stdio.h"
#define CR 13 /* this defines CR to be 13 */
#define LF 10 /* this defines LF to be 10 */

main()
{
char c;

printf("Input any characters, hit X to stop.\n");

do {
c = getch(); /* get a character */
putchar(c); /* display the hit key */
if (c == CR) putchar(LF); /* if it is a carriage return
put out a linefeed too */
} while (c != 'X');

printf("\nEnd of program.\n");
}


  3 Responses to “Category : C Source Code
Archive   : C-TUTOR.ZIP
Filename : BETTERIN.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/