From the course: Complete Guide to C Programming Foundations
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Challenge: Access database records - C Tutorial
From the course: Complete Guide to C Programming Foundations
Challenge: Access database records
(pensive music) - [Instructor] For this challenge, you need the presidents.dat database file created in an earlier video in this chapter. Your task is to read in the 10 records stored in this file, but to do so backwards, from 10 through 1. To output the records backwards, use the fseek function to set the file position indicator. Obtain each record from the file in reverse order, outputting them one after the other. This challenge seems easy, but it may trip you up. I've provided a code skeleton to help you start. It's available in the exercise files. Also, feel free to borrow code written elsewhere in this course to use the sample person structure defined for creating the presidents.dat file. This challenge should take around 10 minutes to complete.
Contents
-
-
-
-
-
-
-
-
-
-
-
(Locked)
Reading from a file3m 31s
-
(Locked)
Writing to a file3m 40s
-
(Locked)
Challenge: Writing and reading files1m
-
(Locked)
Solution: Writing and reading files4m 4s
-
(Locked)
Working with raw data3m 4s
-
(Locked)
Using random file access3m 21s
-
(Locked)
Challenge: Access database records56s
-
(Locked)
Solution: Access database records2m 51s
-
(Locked)
Manipulating files2m 34s
-
(Locked)
Exploring the path1m 50s
-
(Locked)
Reading a directory3m 36s
-
(Locked)
Getting file information3m 26s
-
(Locked)
Chapter challenge: Managing files1m 46s
-
(Locked)
Chapter solution: Managing files2m 50s
-
(Locked)
-
-