C Programming - File - fwrite
I've got a question regarding programming and files. while(current!=NULL) { if(current->Id_Doctor!='\0') { current=current->next; id_doc=(current->Id_Doctor); } if(current->Id_Doctor=='\0') { id_doc=id_doc+1; printf("%d", id_doc); break; } } fwrite(&id_doc, sizeof(char), 1, Archivo); I dont know why but it aint writing the value of id_doc on the binary file called 'Archivo'...what could be the problem? I added a printf of id_doc and the value was printed..I really dont know Ok, heres the full code(more-less): struct Medico { int Id_Doctor; int Estado; char Nombre[60]; char Clave_Acceso[20];