diff --git a/inc/alumnos.h b/inc/alumnos.h index 037a37c..7c8f8ed 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 AlejandroRougier(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..6f49575 100644 --- a/src/alumnos.c +++ b/src/alumnos.c @@ -46,4 +46,14 @@ bool SerializarAlumno(char * cadena, size_t espacio, const alumno_t alumno) { return (resultado >= 0); } + bool AlejandroRougier(char * cadena, size_t espacio) { + const struct alumno_s alumno = { + .apellidos = "ROUGIER", + .nombres = "Omar Alejandro", + .documento = "22.661.059", + }; + + return SerializarAlumno(cadena, espacio, &alumno); + } + /*=====[Implementations of private functions]================================*/ diff --git a/src/main.c b/src/main.c index a7e9e9e..fb8b699 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 (AlejandroRougier(cadena, sizeof(cadena))) { + printf("Alumno: %s\r\n", cadena); + } else { + printf("No se pudo serializar el alumno\r\n"); + } + return 0; }