Hey ,I was trying to design a code to handle file.It consists of character nodes.Line nodes that include character nodes. and a file that includes line node .
I wrote this code below,but it won't work.Wonder if some-one can help spot the error.
Code:
typedef struct CharacterNode {
struct CharacterNode *nextCharacterNode;
char data;
}characterNode;
typedef struct LineNode {
struct CharacterNode *characterNode;
struct LineNode *nextLineNode;
}lineNode;
typedef struct fileADT {
struct LineNode *lineNode;
int size;
}FileADT;
void initFileADT(FileADT *file) {
file->lineNode = NULL;
file->size=0;
}
int main(int argc, char *argv[]) {
FileADT *a;
a=NULL;
initFileADT(a);
return EXIT_SUCCESS;
}
thanx ppl