Get up and running with a compiler. Recall how to write functions.
The main goal of this tutorial is to ensure that you have everything you need to write C++ code on your own computer. You will need to install a compiler and a text editor and make sure that you can use the comand line.
On the 3891 software page, you will find instructions for installing various useful bits and pieces. You will want to install, on your primary computer,
You may also want a graphical Integrated Development Environment (IDE), but that’s optional. Although IDEs can be very helpful (like an automatic transmission), a goal of this course is to learn what’s really going on under the hood, so we’ll be using the command line (like a manual transmission) in the lab.
Once you have installed the various bits of software, visit the basic skills and ensure that you are comfortable with the process of opening a terminal and interacting with the computer via the command line.
If you get your tools up and running before the end of the tutorial,
you can try your hand at writing a small function to refresh your
Download the following C++ source file, which declares but does not
define (do you remember the difference?) the
Now try to compile this source file at the command line:
$ clang++ tutorial1.cpp -o tutorial1
You should see an error message because the
term function has been
declared and used but not defined.
As an exercise, define the
term function, then test it by compiling
the C++ source file and running the resulting program:
$ clang++ tutorial1.cpp -o tutorial1 $ ./tutorial1