Re: printing error messages
- From: Richard<rgrdev@xxxxxxxxx>
- Date: Sat, 31 May 2008 20:06:06 +0200
"Bill Cunningham" <nospam@xxxxxxxxx> writes:
"gsa" <hsggwk@xxxxxxxxx> wrote in message
news:dd7b86c4-554d-439d-ac90-a522770ce6ce@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I just stuck the error function call in the if block and it worked.
if((fp = fopen(stretchesFile, "w")) == NULL) {
error(1, errno, "could not open file %s", stretchesFile);
exit(1);
}
Thanks again for your help!!
For my 2 cents worth exit(1) isn't portable. Try exit(EXIT_FAILURE) from
stdlib.h. For me it has made the difference between a working and non
working program.
Bill
I do not believe you. I would be interested in seeing this program that
suddenly magically worked when you change the code you call exit with.
.
- References:
- printing error messages
- From: gsa
- Re: printing error messages
- From: Walter Roberson
- Re: printing error messages
- From: gsa
- Re: printing error messages
- From: gsa
- Re: printing error messages
- From: Bill Cunningham
- printing error messages
- Prev by Date: Re: malloc()/realloc() - have I got this right?
- Next by Date: Re: How to print an array of char backward.
- Previous by thread: Re: printing error messages
- Next by thread: Re: printing error messages
- Index(es):
Relevant Pages
|