Author Topic: Feel like a dumbass (C / C++)  (Read 99 times)

0 Members and 1 Guest are viewing this topic.

Offline Travelsonic

  • *****
  • Posts: 743
  • We're gonna need a new obstacle course...
  • Respect: +78
Feel like a dumbass (C / C++)
« on: October 18, 2012, 02:18:40 PM »
0
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.
lim ( Δ :trollface: -> 0 ) (:trollface: + Δ :trollface:)² + :trollface: = :trollface: