Problem 310 solution pg 120 the code generated when

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ((p = calloc(nmemb, size)) == NULL) unix_error("Calloc error"); return p; } void Free(void *ptr) { free(ptr); } /********************************************************* * Error-handling wrappers for the Standard I/O functions. *********************************************************/ void Fclose(FILE *fp) { if (fclose(fp) != 0) unix_error("Fclose error"); } FILE *Fdopen(int fd, const char *type) { FILE *fp; if ((fp = fdopen(fd, type)) == NULL) unix_error("Fdopen error"); return fp; } 680 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 APPENDIX A. ERROR HANDLING char *Fgets(char *ptr, int n, FILE *stream) { char *rptr; if (((rptr = fgets(ptr, n, stream)) == NULL) && ferror(stream)) app_error("Fgets error"); return rptr; } FILE *Fopen(const char *filename, const char *mode) { FILE *fp; if ((fp = fopen(filename, mode))...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online