Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Roboart committed Apr 10, 2021
2 parents 9b2fd53 + 71a81c7 commit 0f165e5
Show file tree
Hide file tree
Showing 3 changed files with 17 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 @@ -43,6 +43,8 @@ bool SerializarAlumno(char * cadena, size_t espacio, const alumno_t alumno);

bool RodriguezOsvaldo(char * cadena, size_t espacio);

bool IvanVargasMarza(char * cadena, size_t espacio);

bool NicolasVargas(char * cadena, size_t espacio);

bool FedericoMeghinasso(char * cadena, size_t espacio);
Expand Down
9 changes: 9 additions & 0 deletions src/alumnos.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ bool SerializarAlumno(char *cadena, size_t espacio, const alumno_t alumno)

return (resultado >= 0);
}
bool IvanVargasMarza(char * cadena, size_t espacio) {
const struct alumno_s alumno = {
.apellidos = "VARGAS",
.nombres = "Ivan",
.documento = "38.170.436",
};

return SerializarAlumno(cadena, espacio, &alumno);
}

bool RodriguezOsvaldo(char * cadena, size_t espacio) {
const struct alumno_s alumno = {
Expand Down
6 changes: 6 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ int main(int argc, char *argv[]) {
} else {
printf("No se pudo serializar el alumno\r\n");
}

if (IvanVargasMarza(cadena, sizeof(cadena))) {
printf("Alumno: %s\r\n", cadena);
} else {
printf("No se pudo serializar el alumno\r\n");
}

if (NicolasVargas(cadena, sizeof(cadena))) {
printf("Alumno: %s\r\n", cadena);
Expand Down

0 comments on commit 0f165e5

Please sign in to comment.