-
Go to the department home page at http://www.mathcs.carleton.edu
.
-
Click on "course information" on the left hand side.
-
Under "Specific Course Resources," click on "CS 117: Introduction to Computer
Science."
-
This web page has lots of information which you may find useful, and you
may want to bookmark it. In particular, click on "Intro to C++ on Linux."
-
This web page, titled "How to Write and Compile a C++ Program Using g++,"
contains detailed instructions on building a C++ program. Follow all the
instructions on this web page.
-
What happens if you remove the "<< endl" and recompile and
rerun the program?
-
What happens if you remove the "#include <iostream>" and recompile
the program?
-
You don't have to name the executable program the same thing as the source
code, though it is usually a good idea to do so. Try recompiling
like so:
g++ -o schillerhead myprogram.cpp
Do an "ls" to make sure the new executable is in your directory, then
run the program using the new executable.
-
Type "ls -l". This gives you the detailed listing of the files in
the current directory. The fourth column in this listing gives you
the size, in bytes, of each file. How does the size of the executable
program compare with the size of the source code? To save space in
your account, you can remove old executables using, for example, "rm hello".