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
Post a Comment