That getch() behavior (same thing with getchar()) seems to be a Microsoft Visual C++ "feature".

I compiled your code in Dev-C++ and with Borland C++ Builder 5.5 and both of them printed "Why wasn't this printed before the getch()??" before pausing for the getch().

I also compiled it with CC on my school's Unix system. getch() didn't work at all there so I had to change it to getchar() and #include <stdio.h>, and then it also printed the line before pausing.