|
Tips on Using Microsoft Visual C++ Version 6.0 |
This page collects various tips about Microsoft Visual C++ system used in 142 and 143. If you learn other things that you think we should post here for the benefit of all, please send mail to cse142-webmaster@cs.washington.edu.
You should notice that the words project and workspace are easily confused. The following is freely plaigerized from Microsoft documentation:
A project workspace is the area defined that contains your projects and their configurations. A project is defined as a configuration and a group of files that produce an program or final binary file(s). A project workspace can contain multiple projects, even projects of different types (for instance, Microsoft Visual C++ and Microsoft Visual J++ projects).
Note that if you save your work on the c: drive of the computer you are working on (by selecting a location like c:\temp for your project location), it will be erased when the computer is rebooted. You can save your work on the c: drive, but make sure that you copy it to a diskette when you are done. It is a better idea to just work off your floppy disk that is in the a: drive.
Once you have named your project and specified the location, click OK. Another dialog box will pop up asking you what kind of console application you wish to create. Choose "An empty project" and click Finish. When the New Project Information box comes up, clikc OK to dismiss it.
If you put your workspace and files on your floppy disk, it is a good idea to configure your workspace to write the compiler's intermediate files to the hard disk. Details are below.
button.
After your project is created, pull down the "Project" menu, and choose "Settings." On the "General" tab of the dialog box that pops up, change the settings for both of the Output directories ("Intermediate files" and "Output files") from "Debug" to "c:\temp". Click OK, and then go to the file menu and choose "Save workspace." Now, everything that comes out of the compiler will be written to the C: drive, but all of the C++ code that you write will stay on your floppy. You do not need to cleanup anything on the C: drive when you're done, as those files are all binary.
icon from
the toolbar (it is near the top right of the screen).
icon once again.
C:\test\main.c(6)"?
You don't have to. Try double-clicking on the line "
C:\test\main.c(6)". The compiler will jump to that
line automatically.
Here is another method: When you compile your project and get a list of errors in the output window, you can use the F4 key to step through those errors. Each time you press F4, the keyboard cursor will be moved to the line where the error occured and little blue arrow will be placed on the side of that line to show you where you are. Meanwhile, the current error will be highlighted (in blue) in the output window, so if you press F1 ( context-sensitive help) MSVC++ will bring up the help page for that error.
printf("\nWelcome\n"); you will get
some strange characters before and after "Welcome".
So change the above code to three lines of code: printf(" "); printf("Welcome"); printf("
");
To run Microsoft Visual C++ version 6.0, you need:
Professional Edition
printf
" which you are not familiar with, use the mouse to click on
"printf" such that "printf
" is highlighted. Press F1 and Visual C will launch the online
help.