Lab 1: Get In Line

http://www.cs.tufts.edu/comp/15/labs/lab1

Overview

In this lab you will build a simple queue of names, implemented as a linked list of strings. The goal of the lab is to get your programming skills warmed up, and to give you some code to start with when the first programming project is assigned (soon!)

Getting started

Start by copying three files from /comp/15/labs/lab1 into your home directory (I recommend making a subdirectory called comp15 with another directory inside it called lab1). The three files are:

You can copy them in one command:

cp /comp/15/labs/lab1/* .

Compiling and Running

Edit, Save, and Compile Often!!!

You can use one of two compilers: g++ or clang++. I recommend using clang++ because it gives much better error messages.

clang++ main.cpp queue.cpp -o mytest

To debug your code (especially if you have segmentation faults) you can use gdb (see my quick reference on using the debugger). I also urge you to try running your program using valgrind, a very cool program that checks your program for pointer and allocation problems. Run it like this:

valgrind ./mytest

Providing your Code

As always, you should provide your source code before you leave. The assignment name is lab1.

provide comp15 lab1 sequence.cpp main.cpp