In this module we bridge some of the Object-Oriented ideas and Java constructs to C++. We cover the basics on how to build, link, and run C++ code, as well as show how C++ constructs interact with the memory model we developed during the semester for Java.
We then cover some of the correspondence between Java and C++ constructs through a series of examples. We conclude this module with an introduction to pointers and memory management in C++.
- Given a set of C++ source files, compile and run the program.
- Given an UML class diagram, translate the corresponding C++ classes.
- Given a C++ class and an operator, write the member function that overloads the operator.
- Given a structure definition in C++, implement a function that operates on a struct.
- Given a union definition in C++, implement a function that operates on a union.
- Given C++ code that uses pointers, draw a diagram to showing memory state on the stack and heap.
- Write a C++ program that calls a member function that uses pass by reference arguments.
- Explain what a destructor member function does in C++.
- Explain what a copy constructor member function does in C++.
- Given an operator, contrast operator overloading in C++ with method overloading in Java.