10 Quick Test Prep Questions

Hey you,

So I'm studying for this test and I made a few review questions based on the study guide. Obviously i have my own answers for these but I wanted to post to see what more experienced programmers would answer to questions such as these? Only if you have time, of course! :D

1. Explain operator precedence, associativity, number of operands, etc.

2. Which operators cannot be overloaded?

3. Which operators should not be overloaded and why?

4. When should we use a member overloaded operator and when should we choose a non- member overloaded operator?

6. What are the pros and cons of making a function a friend of a class.
7. Describe the this* pointer:

8. What are the different modes that files may be opened in?

9. Code for file related functions.

10. How do you create a function template?

11. What is it for?

12. Differences in how to use an overloaded operator function in a template?
1_ The problems of `infix' notation

2_ Language dependant. RTFM (that would be my answer)

4_ You are talking when we do have choice, ┬┐right?
Non-members are useful for generalization http://www.boost.org/doc/libs/1_52_0/libs/utility/operators.htm
(to clarify, that's how it's implemented in boost, you need to provide the member ones)

5_ 42

12_ ┬┐?
icic, so heres the actual study guide: if any of you can help really quick it would definately help me prepare for my test tomorrow! Thanks!

These are the concepts that you should be familiar with for Exam #3.

Overloaded operators:
- Basic facts (precedence, associativity,number of operands, etc.)
- Operators that cannot be overloaded
- Operators that should not be overloaded
- Member and non-member overloaded operators
- Function calls that are equivalent

Friend functions:
- Pros and cons of making a function a friend of a class

'this' pointer:
- What it is.

File I/O:
- File I/O classes.
- Modes that files can be opened in.
- File I/O related functions.

Function template:
- What it is.
- How to create one.
- Differences with overloaded function.
Topic archived. No new replies allowed.