Maybe this comes a bit late but for what it's worth, on a unix/linux box do ls /usr/{local/,}include/c++/*
or similar, according to your layout and paths. You could pipe to grep
looking for the header in question, like:
ls /usr/{local/,}include/c++/* | grep iostream
This entails a look-up for iostream.h
as well as any other superstrings.
Or run find / -type f -name iostream 2> /dev/null | grep include
or locate iostream | grep include
(provided the database is current, otherwise prepend with a call to updatedb
)--these, however, will print also non-system-wide includes, so please adjust appropriately.
The actual C++ include path is easily found with something like:
g++ -v 2>&1| sed -rn 's/.+gxx-include[^=]+=([^ ]+).+/\1/p' # adjust iff empty
Equivalently on Windows and other machines. I guess the idea is clear--such a file as iostream.h
doesn't exist in the system include path by default any longer, you still, however, can find legacy libc++ distributions with iostream.h
either soft-linked to iostream
or as its copy. So this is not a matter of style but rather of the circumstances. You could ship your own iostream.h
with your project just make sure it's contained in the include path where your compiler looks up for the <...>
headers.
cstdio
, notstdio.h
(the latter is deprecated).<cstdio>
is guaranteed to provide the names innamespace std
is reason enough for me to prefer it. I know that it might also provide them in the global name-space just as<stdio.h>
might provide them innamespace std
. It is also a matter of consistency if you make it a habit to always use the<c…>
headers. And for some headers, you'll really want this because they enhance the C interface with additional function overloads, for example.