summaryrefslogtreecommitdiff
path: root/strlen.c
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2018-11-16 13:57:07 +0000
committerIan C <ianc@noddybox.co.uk>2018-11-16 13:57:07 +0000
commit975754ba15088168d33f5801dd3393644a350553 (patch)
tree6b4df2d529c33940335e20652df249b77de8b0aa /strlen.c
parent10280a648f9caa1836f9b461301467194d091787 (diff)
Added strlen. Updated .bashrc and aliases to use vim for vi and added home bin.
Diffstat (limited to 'strlen.c')
-rw-r--r--strlen.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/strlen.c b/strlen.c
new file mode 100644
index 0000000..a7fead6
--- /dev/null
+++ b/strlen.c
@@ -0,0 +1,17 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+int main(int argc, char *argv[])
+{
+ int f;
+ int len;
+
+ for(f = 1; argv[f]; f++)
+ {
+ len = strlen(argv[f]);
+ printf("strlen(%s) = %d\n", argv[f], len);
+ }
+
+ return EXIT_SUCCESS;
+}