Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!

Timeline for answer to C++ reinterpret_cast by sbi

Current License: CC BY-SA 2.5

Post Revisions

5 events
when toggle format what by license comment
Jul 29, 2010 at 8:36 vote accept Gokul
Jul 29, 2010 at 8:34 history edited sbi CC BY-SA 2.5
added 847 characters in body; deleted 22 characters in body
Jul 29, 2010 at 8:26 comment added DevSolar +1, correct answer. @Gokul: Try this instead of line 6: const GOK_UINT8* tmp = reinterpret_cast<const GOK_UINT8*>(c); const pGOK_UINT8 y = tmp;. You will see the reinterpret_cast works fine, it's the type mismatch in the assignment that results in an error. That being said, be aware that your code exhibits about as many bad coding practices as it has lines... I hope this is for experimentation only. ;-)
Jul 29, 2010 at 8:19 history edited sbi CC BY-SA 2.5
added 118 characters in body; deleted 5 characters in body
Jul 29, 2010 at 8:13 history answered sbi CC BY-SA 2.5