CS3060 (Spring 2013): Midterm
Variables and Expressions
Each question is worth 25 points.
- What are constructors and destructors? How do they prevent memory leaks? Why does the
garbage collected nature of Java not require a destructor?
- Describe the behavior and meaning of
are the C analogues?
- In C, everything is pass by value. How is pass by reference accomplished in C++ and
why is this useful? Why is return by reference useful? Give a specific example.
- What is operator overloading? When is operator overloading bad? What is the
significance of the
friend keyword and why is it relevant to operator
Send your answers in a PDF (do not send a Word Document) to bparks AT uccs DOT edu.