Skip to content

Commit

Permalink
"Se agregan todos los datos del alumno Geronimo, Franco"
Browse files Browse the repository at this point in the history
  • Loading branch information
Franco414 committed Apr 10, 2021
1 parent cb86520 commit e334b29
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion inc/alumnos.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ typedef struct alumno_s {
/*=====[Prototypes (declarations) of public functions]=======================*/

bool SerializarAlumno(char * cadena, size_t espacio, const alumno_t alumno);

bool FrancoGeronimo(char * cadena, size_t espacio);
/*=====[Prototypes (declarations) of public interrupt functions]=============*/

/*=====[C++ - end]===========================================================*/
Expand Down
9 changes: 8 additions & 1 deletion src/alumnos.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,12 @@ bool SerializarAlumno(char * cadena, size_t espacio, const alumno_t alumno) {

return (resultado >= 0);
}

bool FrancoGeronimo(char * cadena, size_t espacio) {
const struct alumno_s alumno = {
.apellidos = "GERONIMO",
.nombres = "Franco Ezequiel",
.documento = "39.399.713",
};
return SerializarAlumno(cadena, espacio, &alumno);
}
/*=====[Implementations of private functions]================================*/
6 changes: 6 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,11 @@
/*=====[Implementations of private functions]================================*/

int main(int argc, char *argv[]) {
char cadena[128];
if (FrancoGeronimo(cadena, sizeof(cadena))) {
printf("Alumno: %s\r\n", cadena);
} else {
printf("No se pudo serializar el alumno\r\n");
}
return 0;
}

0 comments on commit e334b29

Please sign in to comment.