aboutsummaryrefslogtreecommitdiff
path: root/l/strlen.lang
diff options
context:
space:
mode:
Diffstat (limited to 'l/strlen.lang')
-rw-r--r--l/strlen.lang11
1 files changed, 11 insertions, 0 deletions
diff --git a/l/strlen.lang b/l/strlen.lang
new file mode 100644
index 0000000..27c23a3
--- /dev/null
+++ b/l/strlen.lang
@@ -0,0 +1,11 @@
+func int strlen(char[] str) {
+ int i := 0;
+ char c := str[i];
+ while (c != '\0') {
+ i = i + 1;
+ c = str[i];
+ }
+ return i;
+}
+
+func int main() {return 0;}