Reader small image

You're reading from  Learn C Programming. - Second Edition

Product typeBook
Published inAug 2022
PublisherPackt
ISBN-139781801078450
Edition2nd Edition
Right arrow
Author (1)
Jeff Szuhay
Jeff Szuhay
author image
Jeff Szuhay

Jeff Szuhay is the principal developer at QuarterTil2 which specializes in graphics-rich software chronographs for desktop environments. In his software career of over 35 years, he has engaged in a full range of development activities from systems analysis and systems performance tuning to application design, from initial development through full testing and final delivery. Throughout that time, he has taught computer applications and programming languages at various educational levels from elementary school students to university students, as well as developed and presented professional, on-site training.
Read more about Jeff Szuhay

Right arrow

Chapter 23 – Using File Input and File Output

  1. Because of the variety of input and output, we needed to verify each possible execution path within our program.
  2. If a specified input file does not exist, it makes no sense to continue processing. The program must exit.
  3. When an output file is opened for writing, its current contents are cleared and a file is created with new data. When an output file is opened for appending, any new data is added to the end of the file; the pre-existing file data is preserved.
  4. Handling the final <newline> character when using fgets() depends upon the context in which fgets() is used. In the last chapter, we used a wrapper function around fgets(). In this chapter, we didn't need to do that, since the trimStr() function is always used after fgets(), which removes all leading and trailing whitespace.
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Learn C Programming. - Second Edition
Published in: Aug 2022Publisher: PacktISBN-13: 9781801078450

Author (1)

author image
Jeff Szuhay

Jeff Szuhay is the principal developer at QuarterTil2 which specializes in graphics-rich software chronographs for desktop environments. In his software career of over 35 years, he has engaged in a full range of development activities from systems analysis and systems performance tuning to application design, from initial development through full testing and final delivery. Throughout that time, he has taught computer applications and programming languages at various educational levels from elementary school students to university students, as well as developed and presented professional, on-site training.
Read more about Jeff Szuhay