Our Environment • We will exercise on Microsoft Visual C++ v.6 • because that is what we have in the univ. • but there are many free compilers, too.
Visual C++ (v6) New.. Ctrl+N
Visual C++ (v6) projecttitle (name of .exe) Project and file directory Choose: “Win32 Console Application”
Visual C++ (v6) New source file will be included in the project
Visual C++ (v6) Give a file name with extension .c Choose: “c++ source file”
Visual C++ (v6) Write your program here
Visual C++ (v6) Compile the C file
Visual C++ (v6) Build an executable (.exe) file.
Visual C++ (v6) Run the executable file (.exe). When this menu is selected, even if the compiling was not complete, it will re-compile. Error and warning messags will be here.
Visual C++ (v6) Program output and interface at DOS prompt.
Visual C++ (v6) Open a previously created project.
Error investigation There is a variable which is forgotten to be declared before used. By double clicking on the error message, you can go to the line containing the error.
Debugging Add an integer variable with name “a”
Linker errors A function with name “print” is not defined.
Until now, you should have encountered programming mistakes. Use debugger: Build->set active configuration-> win32 debug
Insert breakpoint Put break point Chose line • Start debugging with “F5” or • Build->Start Debug->Go
Debug screen Debug toolbar Current running line Functions Stack Variables watching
Run line by line by pressing “F10” or clicking this button Trace variable values here