// TODO: call SetSource(200) on all instances of type SystemEvent. You will need two type casts for this...
SystemEvent*sep=dynamic_cast<SystemEvent*>(const_cast<Event*>(e));// we need dynamic_cast for finding the relevant elements as well as
if(sep){// sep will be nullptr, if dynamic_cast fails const_cast to temporarily modify const-ness of Event* type
sep->SetSource(200);
}
}
// print each byte of f in hex:
for(size_ti=sizeof(f)-1;i>=0;--i){
printf("%hhx",static_cast<unsignedchar>(0));// TODO replace static_cast<unsigned char>(0) with correct expression. Use a type cast -- is it required?
printf("0x");
for(size_ti=sizeof(f);i-->0;){
//printf("%hhx", static_cast<unsigned char>(0)); // TODO replace static_cast<unsigned char>(0) with correct expression. Use a type cast -- is it required?
printf("%hhx",reinterpret_cast<uint8_t*>(&f)[i]);// reinterpret_cast is required here!