CS253 IQ 08
See this page as a slide show
Reflection
int zulu;
cout << typeid(zulu).name() << '\n';
i
What will this code emit?
int zulu
int
zulu
i
- It cannot be determined.
Virtual Inheritance
What problem does virtual inheritance address?
- Stroustrup’s Syntax Sin
- Polymorphic Pointers
- Namespace Numbering
- Method Mangling
- Dreaded Diamond
Programming Paradigms
Which statement is true?
Makefile
s are event-driven.
- C++ is event-driven.
- Spreadsheets are imperative.
- Graphics programs are declarative.
- Object files are declarative.
- This question is ill-defined.
Exceptions
What sort of argument can throw
take?
- only
std::Exception
and classes derived from it
- any scalar or object
- any scalar or copy-constructable object
- any object
- any copy-constructable object
Exceptions
int main() {
throw 42;
cout << "honeybee\n";
}
terminate called after throwing an instance of 'int'
SIGABRT: Aborted
🐝
What will this program display?
42
honeybee
an error message
honeybee
an error message
- an error message
honeybee
honeybee
- an error message