I am running a program with 3 structures and what I am doing to read/write in the binary file is the following:
struct Medico
{
int Id_Doctor;
int Es
I'm assuming your struct looks like this:
struct Medicazos
{
char Nombre[60];
char Clave_Acceso[20];
char Especialidad[40];
int Id_Doctor;
int Estado;
}
You can read/write/copy this guy around as a single unit. There's no need to do piecemeal access until you're ready to actually use the values.
struct Medicazos m = {"Bob", "Password", "Feet", 123, 456};
FILE* f = fopen(...);
fwrite(&m, sizeof(struct Medicazos), 1, f);
And the same (but backward) for fread
.
(By the way, your capitalized variable names are killing me.)