My assignment this week is to go create a program that reads a data file that my professor sent to me. The assignment says there are 10 integers in this data that I need to write to an array, which I've done but I'm not sure if it's correct or just junk data. I will attach the a DL link for this file (it's only 40bytes). I've created a program below that will read off the 10 numbers that I need, but how do I know if it is junk data or the real deal. I am getting the same numbers everytime, is that an indication that I'm doing this correctly? Any long term tips for me to use in the future would be appreciated as well.
Here is the DL link mysteryData
#include <stdio.h>
#include <string.h>
int main(void)
{
int i;
FILE* myFile = NULL;
myFile = fopen("mysteryData.dat", "rb");
int Mystery[10] =
{ '\0' };
if (myFile == NULL )
{
printf("Failed to open file\n");
}
else
{
fread(Mystery, sizeof(int), sizeof(Mystery), myFile);
printf("%d\n", Mystery);
}
for (i = 0; i < 9; i++)
{
printf("%d\n", Mystery[i]);
}
fclose(myFile);
}