Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › c++ signed and unsigned
New Posts  All Forums:Forum Nav:

c++ signed and unsigned - Page 2

post #11 of 12
There isn't much to get.

Its simply a prefix that tells the compiler that you're working in a particular base.

() 75 = (base 10) 75 = (base 2) 01001011
(0) 113 = (base 8) 113 = (base 2) 01001011
(0x) 4b = (base 16) 4b = (base 2) 01001011

The base of the number doesn't really matter. A number is a number, no matter what base its in. The processor only operates on binary numbers, so ultimately they will all get converted to base 2. We use different bases simply for simplicity and readability. Hex is used a lot since its much easier to read than binary. 01001011 is 0100 = 4 and 1001 = b (11).
Edited by nathris - 8/6/11 at 9:37am
    
CPUMotherboardGraphicsRAM
Core i5 4670k ASUS Maximus VI Gene Gigabyte GTX 460 1GB Kingston Hyper-X 
Hard DriveHard DriveHard DriveHard Drive
Samsung 830 OCZ Vertex 3 WD6401AALS WD5000AAKS 
CoolingOSMonitorMonitor
Noctua NH-D14 elementary OS Dell Ultrasharp U2312HM LG W2442PA-BF 
KeyboardPowerCaseMouse
Microsoft Sidewinder X4 Corsair HX750W Corsair Graphite 600T Logitech G700 
Audio
ASUS Xonar DG 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Core i5 4670k ASUS Maximus VI Gene Gigabyte GTX 460 1GB Kingston Hyper-X 
Hard DriveHard DriveHard DriveHard Drive
Samsung 830 OCZ Vertex 3 WD6401AALS WD5000AAKS 
CoolingOSMonitorMonitor
Noctua NH-D14 elementary OS Dell Ultrasharp U2312HM LG W2442PA-BF 
KeyboardPowerCaseMouse
Microsoft Sidewinder X4 Corsair HX750W Corsair Graphite 600T Logitech G700 
Audio
ASUS Xonar DG 
  hide details  
Reply
post #12 of 12
The easiest way I found to think about hex to binary is to thing about a pump or something with the rotating numbers. Every time one gets to 9 it bumps the one next to it up one and then resets to 0. Just now instead of it going up to 9 it goes passed that all the way up to F.
Herp
(1 item)
 
  
Other
Dolla Billz Yall! 
  hide details  
Reply
Herp
(1 item)
 
  
Other
Dolla Billz Yall! 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › c++ signed and unsigned