From 58f9c0cf9e115883369b586688a4ac97f4ff8765 Mon Sep 17 00:00:00 2001 From: starnakin Date: Wed, 26 Jul 2023 10:34:17 +0000 Subject: [PATCH] Add wiki/strncpy.md --- wiki/strncpy.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 wiki/strncpy.md diff --git a/wiki/strncpy.md b/wiki/strncpy.md new file mode 100644 index 0000000..2ce7b5d --- /dev/null +++ b/wiki/strncpy.md @@ -0,0 +1,17 @@ +# STRNCPY +Strncpy is a function that takes two chars lists and a number as a parameter and write the second in the first but only the n - 1 first char (like strncpy in C) + +## params +1. chars list +2. chars list +3. number + +## example +``` +strncpy("y", "o", 2) "y" => "o" +strncpy("y", "", 1) "y" => "" +strncpy("", "o", 2) "" => "o" +strncpy("hello ", "world!", 7) => "world!" +strncpy("hello ", "world!", 14) => "world!" +strncpy("hello ", "world!", 0) => "hello " +``` \ No newline at end of file