#include <iostream>
#include <conio>
using namespace std;
int main (){
cout << "Hello World!\n";
cout << "Press any key to continue..."
getch();
return 0;
}
How are you justifying a) including a whole separate header file for a single function and b) doing that for a function that has an equivalent defined in istream and all its derivatives(cin) and c) calling that portable?
cin.get() does the trick for you, really.
"What's up, Doc?"
"'Up' is a relative concept. It has no intrinsic value."
How are you justifying a) including a whole separate header file for a single function and b) doing that for a function that has an equivalent defined in istream and all its derivatives(cin) and c) calling that portable?
cin.get() does the trick for you, really.
because its hello world, not 'This has to pass a code review'.
It is non-portable. Only works in Windows, and it is vulnerable to certain attacks, I believe. Plus it has overhead.
Originally Posted by Adak
io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
Originally Posted by Salem
You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.
Outside of your DOS world, your header file is meaningless.