Foreground color is stored as a single byte, with the background color being stored in a double-byte character set (known as a expanded 8-bit character set). A single-byte character set (SBCS) is a mapping of 256 individual characters to their identifying code values, implemented as a code page. To get the correct result you multiply the foreground color with the expanded bit, so the result is inbetween 0-256 (16 * 16).
The leading scope resolution operator before GetStdHandle in ShowCursor is a trick to call the function directly to avoid any overloading if the function is used anywhere else.
Thanks. Excellent information for me, as well as for those learning coding for the first time too. Sometimes little things like this aren't learnt amongst the big picture things when studying for a degree even