- Write a program to write records of 5 items in file ‘item.dat’. Item class should contain data members code and price.
- Write a program to read first, third and fifth record from the file “item.dat” and display them on monitor.
asking_mitrasBeginner
How to read specific record number in .dat file in C++?
Share
Cpp program to create items.dat file and insert data into IT:
Program to read first, third and fifth data from “items.dat” file:
What if in the first program you had written on the file as
********
Item 1 record:
Item Code: 12
Item Price: 23.99
and so on for all 5 items. How do you read the specific 1sr,3rd and 5th item?
Btw, thanks for your response and the answer. It did help.