home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C Programming Starter Kit 2.0
/
SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso
/
tyc
/
list14_5.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-16
|
302b
|
20 lines
/* Using getch() to input strings. */
#include <stdio.h>
#include <conio.h>
#define MAX 80
main()
{
char ch, buffer[MAX+1];
int x = 0;
while ((ch = getch()) != '\r' && x < MAX)
buffer[x++] = ch;
buffer[x] = '\0';
printf("%s", buffer);
}