This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Nat Sci Lab CS II, Module II Course: 320112 Jacobs University Bremen March 27th, 2008 Dr. Heinrich Stamerjohanns . Assignment 3 - Copy constructors, Class implementation This assignment must be solved in C++. Your programs should include proper declarations for all the variables needed. Insert suitable comments to explain what your program does. Also pay attention to proper indentation of your code. The TAs are supposed to take points off, if the code is not properly indented. Problem 3.1 Copyconstructor (1 point) Play with the examples, it is important to try them out. Based on copyconstructor.cpp (which you find at http://cantaloupe.eecs.jacobs-university.de/courses/320112/cpp/copyconstructor.cpp ) implement funcbyref() . Change all constructors (incl. copy constructor) so that you can clearly see when they are invoked. Then in your main program create objects, call funcbyval() , funcbyref() , and print the results. Then delete the object (by ending the block or program)....
View Full Document
- Spring '10
- C++ Programming