Skip to content

Commit

Permalink
Se agregan los datos del alumno Rodriguez, Osvaldo
Browse files Browse the repository at this point in the history
  • Loading branch information
Roboart committed Apr 10, 2021
1 parent cb86520 commit 4b27b14
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions inc/alumnos.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ typedef struct alumno_s {

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

bool RodriguezOsvaldo(char * cadena, size_t espacio);

/*=====[Prototypes (declarations) of public interrupt functions]=============*/

/*=====[C++ - end]===========================================================*/
Expand Down
9 changes: 9 additions & 0 deletions src/alumnos.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,13 @@ bool SerializarAlumno(char * cadena, size_t espacio, const alumno_t alumno) {
return (resultado >= 0);
}

bool RodriguezOsvaldo(char * cadena, size_t espacio) {
const struct alumno_s alumno = {
.apellidos = "RODRIGUEZ",
.nombres = "Osvaldo Antonio",
.documento = "15.123.345",
};

return SerializarAlumno(cadena, espacio, &alumno);
}
/*=====[Implementations of private functions]================================*/
8 changes: 8 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,13 @@
/*=====[Implementations of private functions]================================*/

int main(int argc, char *argv[]) {
char cadena[128];

if (RodriguezOsvaldo(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 4b27b14

Please sign in to comment.