printing - C++ alternative to perror() -


i know can use

perror() 

in c print errors. wondering if there c++ alternative this, or whether have include (and therefore stdio.h) in program. trying avoid many c functions possible.

thanks!

you like:

std::cerr << strerror(errno) << std::endl; 

that still ends calling strerror, you're substituting 1 c function another. otoh, let write via streams, instead of mixing c , c++ output, thing. @ least afaik, c++ doesn't add library act substitute strerror (other generating std::string, i'm not sure change strerror anyway).


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -