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

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