9511_workbook

solved exercises from algorithms & programming I (9511) prof. Cardozo
Index Commits Files Refs README
commit d0bf697f7ce58fc8c48b288075f6b37e4aa7ea8c
parent ffedae2dbf826e61f4eaf13bd6fed48208e2cd2d
Author: klewer-martin <martin.cachari@gmail.com>
Date:   Sat,  3 Apr 2021 22:33:56 -0300

Update: added ex19.c;

Diffstat:
Aguia05/ex03.c | 11+++++++++++
Aguia05/ex19.c | 30++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+), 0 deletions(-)
diff --git a/guia05/ex03.c b/guia05/ex03.c
@@ -0,0 +1,11 @@
+#include <stdio.h>
+
+typedef struct {
+    unsigned long hours, mins, seconds;
+} time_s;
+
+time_s *stoh(unsigned int sec, time_s *time);
+{
+    time->hours = sec / 3600;
+    time
+}
diff --git a/guia05/ex19.c b/guia05/ex19.c
@@ -0,0 +1,30 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+typedef enum { TRUE, FALSE } bool_t;
+
+ 
+bool_t is_empty_string(const char *str); 
+ 
+int main (void)
+{
+    char str[] = "Hello";
+    char str_empty[] = "";
+
+    printf("%s\n", str);
+    printf("La cadena %s vacia\n", is_empty_string(str) ? "no esta" : "esta");
+
+    printf("%s\n", str_empty);
+    printf("La cadena %s vacia\n", is_empty_string(str_empty) ? "no esta" : "esta");
+
+    return 0;
+}
+
+bool_t is_empty_string(const char *str)
+{
+    if(!strcmp(str, ""))
+        return TRUE;
+
+    return FALSE;
+}