- ___- Is the struct Useful ?? -___
- of course
- see _main_
# ex02 - $\color {Orange} \text {EVAL} $
- `void identify (Base *p)` should check if _dynamic_cast<>_ returns 0/NULL
- ❗ on failure
- <kbd> dynamic_cast<_new_type_>(*) </kbd> return a NULL point of _new_type_
- `void identify (Base & p)` should check with `try...catch`
- ❓ why `try...catch`
- BECAUSE you can have a null pointer, but not a null reference - any reference has to be bound to an object.
- SO when <kbd>dynamic_cast</kbd> for a pointer type fails it returns a null pointer which we can check
- BUT when it fails for a reference type, it cannott return a ___null reference___, so an
- ___- "header must not appear anywhere" -___
- No idea what it means.
ex00 - $\color {Orange} \text {EVAL} $
static_cast
to convert values0
is a bool, a non-printable char and an intint
can be unsigned, long, long long, float, double...signed
tounsigned
long long
tofloat
Scalar
object, prints and returnsex01 - $\color {Orange} \text {EVAL} $
reinterpret_cast<>
Used Twice -_uint_t
Data *
static uintptrt serialize(Data * ) { return (reinterpret_cast(_));
}