I presume you mean console/command window when you say "MSDOS". If not, you have an ancient system whose utility in learning will be minimal.

You can get the name from argv if the user provides it on the command line. Since you're using C++, I would recommend you forego C operations like fopen, fgets, scanf, and fread. Use the C++ wrapped stream I/O for greater flexibility and robustness.