How, in Borland C++, do you make Subroutines? If its code and not the compiler can you list the code?
How, in Borland C++, do you make Subroutines? If its code and not the compiler can you list the code?
#include <iostream>
using namespace std;
void Subroutine()
{
cout << "This is a subroutine for the Borland C++"
"compiler. You don't need to double post";
}
Well, you notice he #include'd <iostream> instead of <iostream.h>
If there is no .h, the functions of iostream are dumped into a namespace, called std
So to call them, you would preface calls with std:: such as
std::cout<<"Whatever";
using namespace std makes the functions found in namespace std available to the global namespace. thus calling cout automatically looks for cout in std.
It is the modern coding standard to include headers without the .h and place a using namespace std after the #includes.