In C++ you can represent an integer literal in 3 different bases: decimal (base 10), octal (base 8), or hexidecimal (base 16). Numbers written the "normal" way (1, 13, 405, ...) are interpreted by the compiler as base 10. Numbers starting with a 0 (01, 040, 0800, ...) are interpreted as base 8. Numbers starting with a 0x (0x1, 0x01, 0x800, ...) are interpreted as base 16.
Note that with base 16 numbers, you can have as many leading 0's after the 0x as you want. That is, 0x1, 0x01, and 0x00000001 are all just 1. The reason you might want to include more leading 0's is for alignment of the code to help with readability. As John Zwinck pointed out it's common for people to use hexidecimal to represent bit flags because every power of 2 can be written with either a 1, 2, 4, or 8 in one of the digits. So you might see something like
unsigned char red = 0x01; // 1 base 10, 00000001 base 2
unsigned char green = 0x02; // 2 base 10, 00000010 base 2
unsigned char blue = 0x04; // 4 base 10, 00000100 base 2
unsigned char yellow = 0x08; // 8 base 10, 00001000 base 2
unsigned char magenta = 0x10; // 16 base 10, 00010000 base 2
unsigned char cyan = 0x20; // 32 base 10, 00100000 base 2
unsigned char white = 0x40; // 64 base 10, 01000000 base 2
unsigned char black = 0x80; // 128 base 10, 10000000 base 2
Really each variable stores a numeric value, but because we're using powers of 2 then each value is represented by a different bit being set to 1. Since the type is an unsigned char which is only 8-bits, you'll never encounter a power larger than 255, or 0xFF hexidecimal, so two digits after the 0x is enough. If you were storing an unsigned short then you might want to write it as 0x0001 which is still just 1, but you're making it obvious that it's a 16-bit integer rather than 8-bit.
You can read more about the different numerical bases in C++ here.