In the following snippett why do the 4 lines starting 'HANDLE hOut;' have to go inside 'int main()'. I would have thought they should run before it as well but they don't, it gives an error saying 'hOut does not name a type'?
Code:#include <iostream>
#include <windows.h>
#include "ShortColours.h"
using namespace std;
int main()
{
HANDLE hOut;
hOut=GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute (hOut, BWI | FBI);
system ("CLS");