From 1a3a3a20773a5664c653a8aebcd10d288962285b Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Tue, 2 Sep 2014 18:54:57 +0200 Subject: Improved directory structure. --- lib/string/string.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lib/string/string.c (limited to 'lib/string') diff --git a/lib/string/string.c b/lib/string/string.c new file mode 100644 index 0000000..45d8ad1 --- /dev/null +++ b/lib/string/string.c @@ -0,0 +1,15 @@ +#include "lib/bool/bool.h" + + +//length 0 for null terminated strings; +bool strcmp(char *str1, char *str2, int length) +{ + int i=0; + + while(true) + { + if(str1[i]!=str2[i])return false; + i++; + if(i==length||str1[i]==str2[i]==0) return true; + } +} -- cgit v1.2.3