From 49c3539f11c2b1831536c0662538aedd2742dc4d Mon Sep 17 00:00:00 2001 From: Esteban Volentini Date: Sat, 10 Apr 2021 12:40:11 -0300 Subject: [PATCH] Se agregan los datos del alumno PERMINGEAT, Alejandro --- inc/alumnos.h | 2 ++ src/alumnos.c | 9 +++++++++ src/main.c | 8 ++++++++ 3 files changed, 19 insertions(+) diff --git a/inc/alumnos.h b/inc/alumnos.h index 037a37c..bed19e9 100644 --- a/inc/alumnos.h +++ b/inc/alumnos.h @@ -41,6 +41,8 @@ typedef struct alumno_s { bool SerializarAlumno(char * cadena, size_t espacio, const alumno_t alumno); +bool AlejandroPermingeat(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..f01d158 100644 --- a/src/alumnos.c +++ b/src/alumnos.c @@ -46,4 +46,13 @@ bool SerializarAlumno(char * cadena, size_t espacio, const alumno_t alumno) { return (resultado >= 0); } +bool AlejandroPermingeat(char * cadena, size_t espacio) { + const struct alumno_s alumno = { + .apellidos = "PERMINGEAT", + .nombres = "Alejandro", + .documento = "00.000.000", + }; + + return SerializarAlumno(cadena, espacio, &alumno); +} /*=====[Implementations of private functions]================================*/ diff --git a/src/main.c b/src/main.c index a7e9e9e..0312db1 100644 --- a/src/main.c +++ b/src/main.c @@ -35,5 +35,13 @@ /*=====[Implementations of private functions]================================*/ int main(int argc, char *argv[]) { + char cadena[128]; + + if (AlejandroPermingeat(cadena, sizeof(cadena))) { + printf("Alumno: %s\r\n", cadena); + } else { + printf("No se pudo serializar el alumno\r\n"); + } + return 0; }