From af2065b30167a152a846ca3281ed9afa1664213f Mon Sep 17 00:00:00 2001 From: Jr130797 Date: Sat, 10 Apr 2021 13:20:14 -0400 Subject: [PATCH] Se agregan los datos del alumno VARGAS MARZA, Ivan --- inc/alumnos.h | 2 ++ src/alumnos.c | 9 +++++++++ src/main.c | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/inc/alumnos.h b/inc/alumnos.h index 037a37c..5f86d45 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 IvanVargasMarza(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..d9998ba 100644 --- a/src/alumnos.c +++ b/src/alumnos.c @@ -45,5 +45,14 @@ 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); +} /*=====[Implementations of private functions]================================*/ diff --git a/src/main.c b/src/main.c index a7e9e9e..1574942 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[120]; + if (IvanVargasMarza(cadena, sizeof(cadena))) { + printf("Alumno: %s\r\n", cadena); + } else { + printf("No se pudo serializar el alumno\r\n"); + } return 0; }