From ea73609c5e72340e3d79d51cf771f676875e701b Mon Sep 17 00:00:00 2001 From: GauravWalia19 Date: Thu, 3 Jan 2019 14:44:59 +0530 Subject: [PATCH] added string ds in c --- C/Data-Structures/STRING/String.c | 16 ++++++++++++++++ C/README.md | 2 ++ datastructures.md | 1 + docs/complexity.md | 4 ++-- 4 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 C/Data-Structures/STRING/String.c diff --git a/C/Data-Structures/STRING/String.c b/C/Data-Structures/STRING/String.c new file mode 100644 index 0000000..caa76d3 --- /dev/null +++ b/C/Data-Structures/STRING/String.c @@ -0,0 +1,16 @@ +#include +#include + +int main() +{ + char str[50]; + printf("Enter any string\n"); + gets(str); + puts(str); + + printf("Length of the string %d",(int)strlen(str)); + if(strcmp(str,"Hello World")==0) + { + printf("Strings are equal\n"); + } +} \ No newline at end of file diff --git a/C/README.md b/C/README.md index 86295bb..f2e5f22 100644 --- a/C/README.md +++ b/C/README.md @@ -22,6 +22,8 @@ #### STRING +* [STRINGS](Data-Structures/STRING/String.c) + #### LISTS * LINKED LIST diff --git a/datastructures.md b/datastructures.md index 945984a..28f3d29 100644 --- a/datastructures.md +++ b/datastructures.md @@ -88,6 +88,7 @@ Indexer for Data Structures Lover * blog * docs * implementation + * [C](C/Data-Structures/STRING/String.c) * [JAVA](Java/Data-Structures/STRING/Strings.java) * complexity diff --git a/docs/complexity.md b/docs/complexity.md index 9583f19..bb347e1 100644 --- a/docs/complexity.md +++ b/docs/complexity.md @@ -65,9 +65,9 @@ This page contains the complexities of different algorithms in this repository. * [HEAPED 3D ARRAY](#dynamic-3d-arrays-(CC++)) * [JAGGED ARRAY](#jagged-array) * [STRING](#string) - * Strings in C + * [Strings in C] + * [Strings in C++] * [Strings in JAVA](#strings-in-java) - * Strings in C++ * [LISTS](#lists) * SINGLE * [SINGULAR LINKED LIST](#singular-linked-list-having-head-and-next)