Question: How would I take this code and write it into a .dat file using fwrite? This is in C #include #include #include int main() {
How would I take this code and write it into a .dat file using fwrite? This is in C
#include #include #include int main() { dog apollo; strcpy( apollo.color, "brown" ); strcpy( apollo.ageInHumanYears, "28" ); strcpy( apollo.height, "1.5"); strcpy( apollo.texture, "rough" );
dog athena; strcpy( athena.color, "golden" ); strcpy( athena.ageInHumanYears, "35"); strcpy( athena.height, "1.8"); strcpy( athena.texture, "silky" );
dog hercules; strcpy( hercules.color, "white" ); strcpy( hercules.ageInHumanYears, "14"); strcpy( hercules.height, "2"); strcpy( hercules.texture, "furry" );
dog zeus; strcpy( zeus.color, "black" ); strcpy( zeus.ageInHumanYears, "42"); strcpy( zeus.height, "1.4"); strcpy( zeus.texture, "fluffy" );
dog poseidon; strcpy( poseidon.color, "gray" ); strcpy( poseidon.ageInHumanYears, "56"); strcpy( poseidon.height, "2.1"); strcpy( poseidon.texture, "dense" );
return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
