Code:
//Paul Omans
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct directory{
char circleName[42];
int startBlock;
};
struct FAT{
char name[42];
char number[42];
int nextBlock;
int previousBlock;
};
int main(){
struct directory directoryClass[10];
struct FAT FATClass[100];
static const char filename[] = "hw7.data";
FILE *file = fopen(filename, "r");
if (file != NULL)
{
char line[128];
while(fgets(line, sizeof line, file)!= NULL)
{
int length = strlen(line); int i;
for(i=0;i<length;i++)
{
//Parse each line into separate words
}
fputs(line, stdout);
}
fclose(file);
}
}
Here's what I have so far. I'm not sure how to parse the line out to separate strings.