This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
CodeBlocksPortable/WATCOM/samples/clibexam/ungetch.c

19 lines
285 B
C

#include <stdio.h>
#include <ctype.h>
#include <conio.h>
void main()
{
int c;
long value;
value = 0;
c = getche();
while( isdigit( c ) ) {
value = value*10 + c - '0';
c = getche();
}
ungetch( c );
printf( "Value=%ld\n", value );
}