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”.
1 2 3 4 5 6 7 | #include <stdio.h> void main() { int r; while ((r = fgetc(stdin)) >= 0) fputc((char)r, stdout); } |
#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) —
GD Star Rating
loading...
170 wordsloading...
Last Post: How to Obtain the Second Distinct Highest Record using SQL?
Next Post: How to Capture Command Output from VBScript at Window Scripting Host?