diff options
Diffstat (limited to 'strlen.c')
-rw-r--r-- | strlen.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/strlen.c b/strlen.c new file mode 100644 index 0000000..efc063f --- /dev/null +++ b/strlen.c @@ -0,0 +1,11 @@ +#include <u.h> +#include <libc.h> + +void +main() +{ + char txt[] = "i'm here now\n"; + + print("len: %ld, lastchar: %c\n", strlen(txt), txt[strlen(txt)-1]); + exits(nil); +} |