How to put our own function declaration in iostream library in C ++?

ostream& tab (ostream &o)
{
    return o << '\t';
}

I want to put this ad in the iostream library. How can i do this?

+5
source share
1 answer

You can not. The contents of the iostream library are defined by the C ++ standard and are potentially available to every C ++ program in the system. Although you can (in practice, this is technically forbidden by the standard) enter things into the namespace stdfor your own program (this is a bad idea, but because of potential name conflicts), and you can define things in your own libraries, you cannot just work around the changes shared libraries for everyone.

+7

All Articles