commit 17ffd82ffdf845875a714be020f1f56dc1473153
parent 77a1b10c9ff15d290a2fa6e6bef4c61e020316d3
Author: Martin J. Klöckner <martin.cachari@gmail.com>
Date: Tue, 24 Nov 2020 08:58:52 -0300
Merge branch 'master' of github.com:klewer-martin/c-repo
Updated README.md
Diffstat:
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/95.11/guia03/ex08_modular.c b/95.11/guia03/ex08_modular.c
@@ -1,10 +1,10 @@
/* Makes a lexicographical comparison between two strings */
-/* similar to strcmp() function from <string.h> */
+/* similar to strcmp() function from <string.h> */
#include <stdio.h>
/* This function calculates the length of given string
- and returns the lenghth by its name as a size_t */
+ and returns the lenghth by its name as a size_t */
size_t str_len(const char *str)
{
if(str == NULL)
@@ -17,10 +17,10 @@ size_t str_len(const char *str)
}
/* This function is equivalent to strcmp() function from
- <string.h> library */
+ <string.h> library */
int str_cmp(const char *str1, const char *str2)
{
- // In case one of the given strings is NULL returns 1;
+// In case one of the given strings is NULL returns 1;
if(str1 == NULL || str2 == NULL)
return 1;
@@ -30,17 +30,17 @@ int str_cmp(const char *str1, const char *str2)
str1_len = str_len(str1);
str2_len = str_len(str2);
- // Assigns the length of the longer string to j;
+// Assigns the length of the longer string to j;
j = (str1_len > str2_len) ? str1_len : str2_len;
- // The for loop itinirate until the longest str ENDs
+// The for loop itinirate until the longest str ENDs
for(i = 0, cmp = 0; i < j; i++) {
aux1 = str1[i];
aux2 = str2[i];
- // This statement assigns to cmp the difference between
- // the two coresponding chars of str1 and str2
+// This statement assigns to cmp the difference between
+// the two coresponding chars of str1 and str2
if(aux1 < aux2) {
cmp -= (aux2 - aux1);
} else if (aux1 > aux2) {
diff --git a/README.md b/README.md
@@ -2,7 +2,7 @@
This is a repository to store all my C files while I learn about this new language.
-In the-c-programming-language/ you can solutions to exercices taken from the book:
+In the-c-programming-language/ you can find solutions to exercices taken from the book:
"The C programming language" - written by Brian W. Kernighan & Dennis M. Ritchie.
In "c-repo/95.11" you can find "Algoritmos y programacion I" (cod. 95.11) homework,