The second quiz will be given during class time on Thursday April 9th, 2015. The quiz will cover material presented over all lectures after the first quiz. Here are some documents that you can use for practice:
- The first quiz will be given during class time on Thursday February 12, 2015. The quiz will cover material presented over the first five lectures.
- Lecture Time and Place: Thursdays 13:35-14:25, Trottier 0100
Course Overview / Prerequisites
This one-credit course will provide a very basic introduction to the C++ programming language.
This course requires that you have already completed at least one
of COMP202, COMP206, COMP208, or COMP250. You should be very familiar
with the C programming language. If you are familiar with Java but not
C, you should be OK but will find you are behind on a couple concepts
(C-style pointers) and ahead on others (object oriented
programming). As C++ builds on C (hence the name C++) we'll
often look at examples comparing and contrasting C++ with
C. That said, Java is very similar to C syntactically, so knowledge of
Java will get you along as well.
Some key differences between C and Java:
- C does not have any notion of objects. (C++ of course, does). The standard library of C is not nearly as rich as Java.
- Java does much more to abstract the notion of pointers/references than C does.
- C allows you to do many things that Java simply does not. For
example, in Java, the following statement would cause a compiler
error: int x = 3.5; . In C, no such error occurs, rather the value is just truncated. In many other cases, Java programs have a fixed response whereas in C they may work sometimes but not others. For example, in Java an array out of bounds error causes the program to crash. In C, it will sometimes crash and sometimes continue to proceed as normal.
This means to program in C you have to be extra careful to avoid mistakes as they are more difficult to find.
- There are several minor syntactical differences between the two. For example, in C you "include" something and in Java you "import" something. (Note that the difference between include and import is actually a bit more subtle than this in some cases, as include is essentially copy/paste, but import is including the namespace.)
- Contact: gcoman [at] cs [dot] mcgill [dot] ca
- Office: McConnell 111
- Office hours: Wednesday 10-11:30 (email if this time is no good and we can find another time)
- Contact: stephanie [dot] laflamme [at] mail [dot] mcgill [dot] ca
- Office: McConnell 112
- Office Hours: Tuesday 1-2:30
- Contact: malika [at] cim [dot] mcgill [dot] ca
- Office: McConnell 403
- Office Hours: Monday 1-2:30PM (starting Feb 2nd)