|
| Week 3 - Tuesday, September 5, 2006 to Friday, September 8, 2006 |
| Pointers and References in C++ |
Comments
Week 3 is just a continuation of the material you will need for Project 1. If you are Java trained, then you need to learn the syntax of C++ pointers. C++ pointers are similar to Java's references, used automatically whenever you pass an object as a parameter to a Java method. There are two big differences, however. First, the syntax requires that you specifically indicate that a pointer is being used. In C and C++ it is also possible to pass an object by value, which means the whole object is copied. There are some big problems with passing an object to a function by value, so generally it is discouraged, even though you can do it in C and C++. The other big difference is that C++ has no protection for null pointers, unlike Java's very polite "null reference exception". If you have an improperly nulled pointer, your C++ program will just crash without explanation in possibly weird ways. The usual crash is a "segmentation fault", which is almost always caused by a bad pointer. But the crash could be very mysterious, or the program might even continue with incorrect execution. Almost anything could happen when a C++ program crashes.
Remember I will be online in the Chat Room for this course in Angel Tuesday and Thursday, from 9:00 pm to 10:00 pm. Also, I will check the Discussion Room at least twice a day. You can also telephone me when I am in my office whenever I am in my office according to my Schedule.
Course Content
Week 3:
Pointers and References
Readings
The following readings are necessary for Project 1, so they will cover both Week 2 and Week 3.
Abstract Data Types and Information Hiding are covered in Section 10.8.
Go through the following chapters reasonably quickly, concentrating on basic concepts, especially those sections that talk about the material in the Week 2 Class Content and the Week 3 Class Content. You don't need to understand all of the details in these chapters. Pay attention to what you need to complete Project 1.
If you're a
Java, but not a C programmer:
Chapter 2 (basics)
Chapter 3 (classes - very
similar to Java)
Chapter 4 (control structures -
very similar to Java)
Chapter 5(control structures -
very similar to Java)
Chapter 6 (be sure to skip
Recursion, which we will cover later)
Chapter 7 (arrays but skip
vectors).
If you're a C,
but not a Java programmer:
Chapter 3 (this will be
significantly new material for you)
Chapter 6 (paying attention to
the differences between functions inside classes and the C functions you are
familiar with)
Lab
Assignment
Since Project 1 is due on Sunday, there will be no lab this week.
Week 3 Test
12 Questions for 4 points, with fractions rounded up.
Only available Friday, September 8th, from 6:00 am to 3:00 am Saturday morning on Angel. It will cover the following material:
| Back to Csc 125 Programming in C++ |
| Scott Badman Office: B132 Phone: 353-2250 sbadman@parkland.edu |
Parkland College, 2400 W. Bradley Avenue, Champaign, IL 61821 |