c-first-steps

a C playground
Index Commits Files Refs README
commit 0ef0e82f58b61734d34d02c9f9197e34077a1d86
parent d718365f88bc92a3c94ed77a48cf7642acce253b
Author: Martin J. Klockner <martin.cachari@gmail.com>
Date:   Wed, 18 Nov 2020 00:19:01 -0300

Added comments to ej8_modular.c;

Diffstat:
M95.11/guia03/ej8_modular.c | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/95.11/guia03/ej8_modular.c b/95.11/guia03/ej8_modular.c
@@ -1,5 +1,11 @@
+/*    Makes a lexicographical comparison between two strings    */
+/*    similar to strlen() function from <string.h>            */
+
 #include <stdio.h>
 
+
+/*    This function calculates the length of given string
+    and returns it by its name                                */
 size_t str_len(const char *str) {
     if(str == NULL)
         return 1;
@@ -10,6 +16,8 @@ size_t str_len(const char *str) {
     return i;
 }
 
+/*    This function is equivalent to strlen() function from    
+    <string.h> library                                        */
 int str_cmp(const char *str1, const char *str2) { 
     if(str1 == NULL || str2 == NULL)
         return 1;