File descriptors and functions like fopen(), fclose(), and fprintf() are showcased in this video.
- [Narrator] The STDIO header file…enables file handling with two main elements.…First a special type called FILE…which works as a model for a file we can read from…or write into.…Second, a series of file handling functions…that operate on variables of this FILE type.…Now let me show you some of these functions.…First we have fopen…which is simply used to open a file…receiving two strings as arguments.…The file name…and the mode in which you want to have access to that file.…
There are several modes to get read or write access…to a file.…These are R for read,…W for write,…and A for append…which means extending a file…by writing at the end of it.…The optional plus sign at the end…means an extended version of these access modes…adding read and write access to the file.…This function returns the address of a file variable…so the way you're supposed to use it…is by assigning its return value…to a file pointer.…On failure it returns NULL.…
Next we have the fclose function…which as you may easily guess…closes a file.…It receives a file pointer…
- Working with header files
- C constants and types
- Unformatted and formatted input/output
- Accessing files with C functions
- Generating random numbers
- Converting strings
- Sorting and searching for data
- Manipulating strings
- Using mathematical functions
Skill Level Intermediate
1. The C Standard Library
2. Input and Output Library: stdio.h
3. General Purpose: stdlib.h
4. String Functions: string.h
5. Mathematical Functions: math.h
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.