Spring 2000 Final Review
Topics From the midterm
- pass-by-value/pass-by-reference
- Definition
- What is the difference between the two?
- When do you use pass-by-value?
- When do you use pass-by-reference?
- How do you implement pass-by-reference using pointers?
- pointers
- Definition
- Using pointers
- Pointer arithmetic
- Addition
- Subtraction
- Use of operators( +, ++, +=, -, --, -=)
- Use of dereference operator (*)
- Use of "address of" operator (&)
- Relation to arrays
- How is pointer like an array?
- How is pointer different?
- Using pointers to access array
- dynamic memory allocation
- Definition
- Why do we need dynamic memory allocation?
- using the new and delete operators
- to allocate a single variable
- to allocate an array
- to delte a variable
- to delete an array (using delete [])
- What is a memory leak?
- Why is it bad?
- strings
- What is a string?
- How are strings represented in memory?
- String functions
- strlen()
- strcpy()
- strncpy()
- strcmp()
- strncmp()
- strcat()
- strncat()
- strstr()
- Difference between the simple string functions
and the 'n' versions of the functions.
- Why is it better to use the 'n' version of the
function?
- recursion
- Definition
- Recursion vs Iterative solutions
- What is the difference between the two?
- Can you solve all recursive problems iteratively?
- Is the reverse true?
- classes
- Abstract data type
- What is a class?
- Declaring a class
- Declaring functions for a class
- Constructors/Destructors
- What are they?
- How to declare them
- Why are they useful
- When do you need a destructor?
- Protection
- What kind of protection/information hiding mechanisms do classes provide?<\li>
- What do private: and public: do?
- Why do we want to be able to control access to members of a class?
- Why are classes useful?
- Function Overloading
- What is it?
- How do you do it?
- How is it useful?
- Types
- What is a type
- What kinds of things can be used as types? (classes, structs, etc...)
Topics From after the midterm
- Operator Overloading
- What is operator overloading?
- How is it useful?
- How do you overload an operator?
- Translating an expression into what function is actually called. (A+B = A.operator+(B)) or operator+(A,B)).
- Overloading operators inside a Class.
- Overloading operators outside the class
- Overloading "<<" and ">>" operators for input/output with the iostreams library.
- Friend functions
- What are they?
- When are they used?
- How are they used?
- Inheritance
- What is inheritance?
- How is it useful?
- Using inheritance
- What is a base class?
- What is a derived class?
- Which functions get called when names in the derived class
conflict with names in the base class?
- What is the "protected:" protection mode and how is it related to inheritance?
- What happens with public, private and protected in the base class when it is inherited
by a derived class?
- In what order are constructors/destructors called?
- Polymorphism/Virtual Functions
- What is Polymorphism
- What are virtual functions?
- How is Polymorphism useful?
- How are virtual functions related to Polymorphism?
- When are virtual functions called?
- How are Class Pointers related to virtual functions?
- Know specifically which functions get called under different circumstances (pointer to the base class, pointer to derived class, base
class object, derived class object, etc...)
- Templates
- What are templates?
- How are they used?
- How are they useful?
- How to declare function templates
- How to declare class templates
That's it for now, I'll be posting sample questions soon... Be patient