Somebody(echoing)!! Anybody(echoing)!! Help me...
I have been a C programmer (NOT C++) for a long time now; and I don't understand why the following code doesn't work.
Code:
#include "iostream.h"
#include "conio.h" // getch()
int main()
{
cout << "Why wasn't this printed before the getch()??";
getch();
return 0;
}
For some reason, the getch() function runs before anything; and it doesn't stop there. There are other functions that are similiar, like delay()'s etc. This problem only occurs when the code is written in C++, NOT C.
For instance; This works fine.
Code:
#include "iostream.h"
#include "conio.h" // getch()
int main()
{
printf("Press any key");
getch();
return 0;
}
I think... I used to know what the problem was; Its probably something small thats overlooked.
[ Compiler: MSVC++ OS: XP ]