Any pointers inside of structs start pointing to nothing. You have to allocate space for them:
Code:
fat pfat;
pfat->dir_array = (dir *)malloc(sizeof(dir));
pfat->dir_array->root_dir=0;
EDIT: If you want an array of dir or files you have to multiply by the size of the array
Code:
fat pfat;
int array_size = 4;
pfat->dir_array = (dir *)malloc(sizeof(dir) * array_size);
pfat->dir_array[0]->root_dir = 0;
If you want fat to be a pointer you have to allocate that as well... Also make sure you create a free function for your structure that first frees any allocated members (dir_array or files_array) then frees the struct itself.
Code:
fat *pfat = (fat *)malloc(sizeof(fat));