|
mkdir euclid |
"Euclid" is the name of the program you will be editing and debugging
in this walkthrough. In order to work with this file, you need to copy
it to the directory you created, so start by changing to that directory.
|
cd euclid cp /class/sce/reference/rcpp/Euclid.cpp . |
This command will copy the program into the current directory. The first argument after cp is the source of the copy (/class/sce/reference/rcpp/Euclid.cpp is the source in this example), and the second argument is the destination to which the file is copied. You can type the entire directory name, but if you use a ".", the file will automatically be copied into the current directory. In this example, your current directory is "euclid" within your personal home directory.
Now you are ready to start editing and debugging the program.
|
|
Alternatively, you can use your mouse to open a file by clicking on the "Files" menu and then scrolling down to "Open...". You will be get a "file dialog" that works similarly to those on Macs and Windows machines. Or, if you wish, you can use the "dired" (directory edit) feature of XEmacs to first open the directory and then open the file from there.
Take a quick look at the Euclid.cpp program. The program is not yet complete and it has a number of syntax and logical errors. Your task will be to complete the editing and debugging of the program so that it correctly computes the greatest common divisor of two numbers using Euclid's algorithm.
Even if you spot the errors
now, do not correct them yet! Wait until you see the error messages that
will be produced.
| Previous | Table of Contents | Continue |