Course Overview / Prerequisites
This one-credit course will provide a very basic introduction to the \Cplusplus~ 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 \Cplusplus builds on C (hence the name \Cplusplus) we'll often look at examples comparing and contrasting \Cplusplus 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 \emph{objects}. (\Cplusplus 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. {\tt 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.)
Instructor Contact info
Daniel Pomerantz- Lecture Time: Tuesday 14:35-15:25
- Contact: dpomer@cs.mcgill.ca
- Office: McConnell 306
- Office hours: Tuesday 13:00-14:15, UPDATED: Thursday 12:30-13:30 PM (email if this time is no good and we can find another time) -- My sincerest apologies, I posted the wrong time for the office hours previously and was thus not there last Friday when they were posted for.
Teaching assistants are also available to help you with programming assignments and course concepts. Their contact information is available on myCourses.
TA Contact hours
Masoud Karzand- Location : 3rd floor of Trottier room 3110
- Time: Monday 14:00-16:45PM
- Contact: masoud.karzand@gmail.com
Chao Zhao
- Location : 3rd floor of Trottier room 3110
- Time: Friday: 14:00-17:00
- Contact: chao.zhao@mail.mcgill.ca
Recommended textbooks
There is no formal textbook for the class. However, I recommend that you obtain one of the standard reference texts on C++. One such book is The C++ Programming Language: 3rd Edition by Bjarne Stroustrup. Another highly recommended book is Accelerated C++ by Andrew Koenig and Barbara Moo. You can purchase this at http://www.amazon.ca/Accelerated-C-Practical-Programming-Example/dp/020170353X.Available at no cost under the GNU Free Documentation License.