diff options
Diffstat (limited to 'strlen.lang')
-rw-r--r-- | strlen.lang | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/strlen.lang b/strlen.lang new file mode 100644 index 0000000..27c23a3 --- /dev/null +++ b/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;} |