diff options
Diffstat (limited to 'euler/source/strings/strlen.cpp')
-rw-r--r-- | euler/source/strings/strlen.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/euler/source/strings/strlen.cpp b/euler/source/strings/strlen.cpp new file mode 100644 index 0000000..7a6fe2a --- /dev/null +++ b/euler/source/strings/strlen.cpp @@ -0,0 +1,12 @@ +#include <cstring> + +namespace std { + + size_t strlen(const char *str) { + size_t len = 0; + while (str[len]) + ++len; + return len; + } + +} |