.:`=-~rANdOm~`-=:. Game Servers

Technology (Read Only) => Programming => Topic started by: Travelsonic on October 18, 2012, 02:18:40 PM

Title: Feel like a dumbass (C / C++)
Post by: Travelsonic on October 18, 2012, 02:18:40 PM
Was messing around today, and I learned something new - annoyingly, seemed like something I should have known a long time ago.

Chars can be displayed as either just that - single characters - or integers, right?  How did I not know that force casting it to a boolean pointer [ex: outputting it like "cout << (bool*)someChar << "\n"; " would display the hexadecimal value?

Shit, this will make programming projects where I work with data in hexadecimal a bit easier to work with so far as displaying it, etc.