If this is C++, then you dont need to declare it struct dir *dir_array, dir *dir_array will suffice.



dir myDir;
fat *pfat = new fat;
pfat->dir_array = new dir[number_of_directories];...