Need someone to code a program for me with my provided files.
Here are the details for this project – Code a new C program that
#includes the .h file and struct that you created in Project 7 (attached)
Opens the binary file (.dat) that someone else posted using your struct (attached)
Uses a while loop and fread ( ), and reads the .dat file into an array of your struct.
Using a function you write, printf’s every member of each struct in the array.
So to summarize:
#include your .h file into your main.c code.
Code using fread ( ) to read the structs from the binary file into an array in your program. (while loop)
In a function you write, use printf ( ) to print out all the members of each struct (inside the while loop) to a text file.
Post the resulting output on the thread.
Submit your code on this assignment.
cars.dat
Porsche
Cars.h
#ifndef Cars_h
#define Cars_h
typedef struct cars {
char manufacturer[35]; //toyota, honda
char model[35]; //camry, civic
char color[20]; //black, red
int seatCapacity; //4,5
float price; //20k, 25k
}
Car;
#endif