2 small utilities i wrote

Tyler Spivey tspivey8 at home.com
Sat Dec 1 17:59:29 EST 2001


code's at the bottom.
not too well written, but they do what they are supposed to do , in my tests.
-- ac2t.c --
/* 
program name: ac2t
this program takes input from stdin and outputs to stdout.
summary: converts input of the form:
ascii-code
ascii-code
..
to the result of those codes.
-1 == eof.
*/
#include <stdio.h>
int main() {
int ch;
while (!feof(stdin)) {
scanf("%d\n",&ch);
printf("%c",ch);
}
}

-- t2ac.c --

/*
program name: t2ac
this program takes input from stdin and outputs to stdout.
summary: converts text to ascii codes, 1 per line. example:
32
65
72
..
-1 (end)
*/
#include <stdio.h>
main() {
int ch;
while (!feof(stdin)) {
ch = getc(stdin); /* get from stdin */
/* print the ascii code, one per line. */
printf("%d\n",ch);
} /* while */
} /* main */
--




More information about the Speakup mailing list