The echo always responses the same text as input until you terminates it by Ctrl+C or Ctrl+Z (End of Line). This is more useful than “Hello, World” in the category of “First Program”.
#include <stdio.h>
void main() {
int r;
while ((r = fgetc(stdin)) >= 0)
fputc((char)r, stdout);
}
The Ctrl+Z will input the End-of-Line so the program knows nothing further more to read.
–EOF (The Ultimate Computing & Technology Blog) —
153 wordsLast Post: How to Obtain the Second Distinct Highest Record using SQL?
Next Post: How to Capture Command Output from VBScript at Window Scripting Host?
