I have a few questions about calling C standard library functions in C++:
- If I want to call
getline()
which is declared in<stdio.h>
is it always sufficient to just include<cstdio>
? This works with the compiler I'm using and I see that it includes<stdio.h>
in<cstdio>
but I want to know if the standard guarantees this. - Are all C standard library functions guaranteed to be available in C++? With the
getline()
example from above I noticed that on cppreference under<cstdio>
it doesn't listgetline()
. - For C standard library functions and types that are made available in the
std::
namespace likeFILE
ormalloc()
are they any problems with accessing them through the global namespace or is it just more idiomatic to access them asstd::FILE
orstd::malloc()
?