If I may add one more little note, rather than using C-style casting, which may be difficult to locate after you've decided the casting is causing an error, consider using the reinterpret_cast, const_cast, and static_cast operators. That way, when you have to find your mistake, it will be...