This is a clean build using libc. - George Edison
Then the answer will depend entirely on the development system and operating system. Libc is not aimed at supporting this kind of thing.
Even if you could figure out how to do this, stdin points to a rather complicated OS or development-dependent FILE data structure that is initialized by libc using routines called before main () starts. Therefore, in a clean assembly, you will also need to do all this. Thus, the simple Hello World C language program makes a pretty good executable on any platform.
If you are writing a simple C program that reads some information from stdin, then parse it all and know exactly what it does, you will have a good start. But it will not be so fast, and what you learn, of course, will not be portable, say, from Visual Studio on Windows, to gcc on Linux.
source share