Re: printing error messages
In article <a13081bb-7012-480f-85e2-de62db236222@j33g2000pri.googlegroups.com>,
gsa <hsggwk@gmail.com> wrote:
> I am new to C so please bear with my stupid questions. I am
>trying to open a file to write, but the code complains that it is
>unable to do so. How do I get C to print the reason it is failing?
>Something like the $! function in perl.
See the documentation on perror(). (Note: perror has some subtle
limitations that can make it a better idea to use the lower-level
equivilents... which you will likely find references to in the
perror() documentation.)
--
"To all, to each! a fair good-night,
And pleasing dreams, and slumbers light" -- Sir Walter Scott
|