2 small utilities i wrote

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 */
--




[Index of Archives]     [Linux for the Blind]     [Fedora Discussioin]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]
  Powered by Linux