I need to read a 49 character string and the sequence of integers that come after it in layout.dat. I wrote this code as a way to test a way to do that. It outputs the string properly, but the ints are completely wrong.
`#include <stdio.h>
#include <stdlib.h>
int main() {
FILE *file;
char nome[50];
int num;
int counter = 1;
file = fopen("layout.dat", "rb");
fread(&nome, sizeof(char), 49, file);
printf("%s\n", nome);
while (!feof(file))
{
for (int i = 0; i < 3; i++)
{
fread(&num, sizeof(int), 1, file);
printf("%d ", num);
}
printf(" obstacle number %d", counter);
counter++;
printf("\n");
}
}`



