How to put our own function declaration in iostream library in c++?
ost开发者_JAVA百科ream& tab (ostream &o)
{
return o << '\t';
}
I want to put this declaration in iostream library..how can i do this??
You can't. The contents of the iostream library are defined by the C++ standard, and potentially shared by every C++ program in the system. Although you can (in practice, this is technically forbidden by the standard) inject things into the std
namespace for your own program (this is a bad idea however due to potential name collisions), and you can define things in your own libraries, you can't just go around modifying common libraries for everyone.
精彩评论