Skip to Main Content
Programming and Data Structures
book

Programming and Data Structures

by Ashok Kamthane
August 2009
Intermediate to advanced content levelIntermediate to advanced
604 pages
21h 39m
English
Pearson India
Content preview from Programming and Data Structures
440 Programming and Data Structures
# includ <proceas.h>
void mainO
{
FTLh fp;
atrucc bike
{
char nazzn [40];
int acvg;
float cost;
struct bike a;
fp=*fopen(’"bk.txt*, "rh *);
i f tfptwiOTIJ.)
{
puts ("Cannot opaa f i l e * ) ;
cocitd) >
}
ClrecrO/
while (fread(&e,sizeof(e),lJp)Bzil)
printf ("\n %s %d %2f'^.name^.avg^.cost);,
fcloseffp);
i
Q m m L
Model Name, Average, Prize: H O N D A 80 45OOO.0O
Model Name, Average, Prize: SUZUKI 65 43000.00
Model Name, Average, Prize: Y A M A H A 55 48000.00
Explanation In the above program the records are written in the binary mode on the disk in the file
"bk . tx t". Record writing will be over af
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Data Structures and Algorithms

Learning Data Structures and Algorithms

Rod Stephens
Data Structures and Algorithms in C++, Second Edition

Data Structures and Algorithms in C++, Second Edition

Michael T. Goodrich, Roberto Tamassia, David M. Mount

Publisher Resources

ISBN: 9789332506343