Advanced Topics in C: Getting Started with File Handling

C 17    |    Expert
  • 18 videos | 2h 31s
  • Includes Assessment
  • Earns a Badge
File handling is an integral part of many medium-to-large-scale programs in C. Files are the most convenient way of managing data for the wide range of programs of this size. You will start this course by considering the advantages of using files in C and the most important functions for file handling, which are fopen() and fclose(). Explore the modes that fopen() can be used with and read and write data to text files. Begin by reading in individual characters with the fgetc() function, whole strings from a file using fgets(), and structured data with the fscanf() function. Discover how to use the r+, a+, and w+ modes, before turning to writing structured data using the fprintf() function. Next, learn how to read and write binary data by leveraging the fread and fwrite functions and the wb and rb modes. Finally, you will perform file seek operations using the functions fseek, ftell, and rewind to control the position your program is operating on in the file stream.

WHAT YOU WILL LEARN

  • discover the key concepts covered in this course
    outline the basic concepts of file handling in C and when they are most appropriate to use
    identify fopen() file modes
    recognize common file functions
    create file handlers
    compare the read, write, and append modes
    read in characters from a file
    read in strings to an array
    read in structured data
  • write data out to a file
    read in data using r+, w+, and a+ modes
    write out structured data
    write out binary data using fwrite()
    read in binary data
    write out and read in structs from binary files
    position a file pointer using the ftell() and fseek() functions
    move a file pointer using the fseek() and rewind() functions
    summarize the key concepts covered in this course

IN THIS COURSE

EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE

Skillsoft is providing you the opportunity to earn a digital badge upon successful completion on some of our courses, which can be shared on any social network or business platform.

Digital badges are yours to keep, forever.

PEOPLE WHO VIEWED THIS ALSO VIEWED THESE