From e334b29ba15912ad686dd69de2ad3e04f622e640 Mon Sep 17 00:00:00 2001 From: Franco414 Date: Sat, 10 Apr 2021 14:20:11 -0300 Subject: [PATCH] "Se agregan todos los datos del alumno Geronimo, Franco" --- inc/alumnos.h | 2 +- src/alumnos.c | 9 ++++++++- src/main.c | 6 ++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/inc/alumnos.h b/inc/alumnos.h index 037a37c..ae4b3a1 100644 --- a/inc/alumnos.h +++ b/inc/alumnos.h @@ -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]===========================================================*/ diff --git a/src/alumnos.c b/src/alumnos.c index 45cce7b..76c2109 100644 --- a/src/alumnos.c +++ b/src/alumnos.c @@ -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]================================*/ diff --git a/src/main.c b/src/main.c index a7e9e9e..5d03a25 100644 --- a/src/main.c +++ b/src/main.c @@ -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; }