I got some simple C code, I'm trying to figure out what I've possibly done to confuse...

dustdut

New member
...my compiler, please help? On the first line where I define this function it gives me an error, conflicting types, also it is probably related but every time I try to make use of my chars (that I take as parameters) it tells me that they are of type char*, which is incorrect

BOOK* bookCreate(BOOK* bookCircleStart, char title[129], char AuthFirst[32], char AuthLast[32], char AuthMid, char isbn[14]) {
BOOK *currentbook;
//NAME *newname = (NAME*) malloc(sizeof(NAME));
NAME newname;
currentbook = bookCircleStart;
while (currentbook != NULL) {
currentbook = (*currentbook).next;
}
(*currentbook).ISBN = isbn;
newname.firstname = AuthFirst;
newname.lastname = AuthLast;
newname.intial = AuthMid;
(*currentbook).author = newname;
(*currentbook).title = title;
(*currentbook).next = (BOOK*) malloc(sizeof(BOOK));
return bookCircleStart;
}

Thanks
 
Back
Top