Random tidbits of knowledge:
If you have an array partially initialized, all other elements are initialized to zero.
IE:
1 2 3
|
int foo[5] = {1};
// is the same as:
int foo[5] = {1,0,0,0,0};
|
---------------------------
Leaving the brakets empty tells the compiler to figure out the size based on the number of initializers, so:
1 2 3
|
char foo[] = {0};
// is the same as:
char foo[1] = {0};
|
----------------------------
In a string or character, the \ character is used to input an escape sequence. If the escape sequence is a number, it is treated as an octal representation of the character. If it's followed by an x then a number, it's a hex representation of a number.
IE:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
// note that the 'A' letter is represented in ASCII as:
// 41 (hex)
// 101 (octal)
// 65 (decimal)
// therefore all of the following lines are equivilent:
char foo = 65; // dec
char foo = 0x41; // hex
char foo = 0101; // oct
char foo = '\x41'; // hex escape
char foo = '\101'; // oct escape
char foo = 'A'; // ASCII code
|
Therefore the '\0' character is just the octal escape sequence for the number 0. And therefore setting the char to 0 has the same effect.
----------------------------
You shouldn't use char strings with WinAPI if you want to be Unicode friendly. Stick with TCHAR.
See this article:
http://cplusplus.com/forum/articles/16820/