Why would you want to do that? Your whole a.out program is passed from the shell, it is an open file descriptor, stdin.
The user can also do this:
cat inpfilename | ./a.out
and now you have absolutely no file name to use (other than / dev / stdin).
If a.out needs to work with file names, why not take the file as a command line argument?
u0b34a0f6ae
source share