开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜