CIS67: Using C++ in a MSDOS Window


We will initially write programs outside of the Visual C++ programming environment. We will use instead very simple means in MS-DOS.

  1. Create an MSDOS Window:

    Click on START then PROGRAMS then the MS-DOS Command Prompt
    [If when you start the MSDOS window you do not find yourself in your home directory, then enter the command G:]

  2. Edit the program, say hmw.cpp, using the command

    NOTEPAD hmw.cpp

  3. Compile the program with the command

    CL hmw.cpp

    If there are error messages, edit the program again with NOTEPAD and recompile.

  4. Run the program with the command

    hmw.exe

    If the program does not run correctly, edit it with NOTEPAD, .. , recompile, ..


It is recommended to create a separate directory for each homework.