0
0to60
I'm coding in MC++ and I'm using the System::Collections data structures to
store my own objects. When I get something out of a hashmap, should I be
using dynamic_cast or old C-style casting? In other words, should it be
Namespace::ObjectName* someObject =
(Namespace::ObjectName*)hashMap->Item(key);
or
Namespace::ObjectName* someObject =
dynamic_cast<Namespace::ObjectName*>(hashMap->Item(key));
store my own objects. When I get something out of a hashmap, should I be
using dynamic_cast or old C-style casting? In other words, should it be
Namespace::ObjectName* someObject =
(Namespace::ObjectName*)hashMap->Item(key);
or
Namespace::ObjectName* someObject =
dynamic_cast<Namespace::ObjectName*>(hashMap->Item(key));