aboutsummaryrefslogtreecommitdiff
path: root/c03/ex03
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-07-06 08:42:30 +0200
committerCharles <sircharlesaze@gmail.com>2019-07-06 08:42:30 +0200
commitd732047d6681b1f64f7907d1c0413abdaab76050 (patch)
treec2123d55a7431de9bb55371dcc78c955da607c6f /c03/ex03
parentaf8435d40cdb8e7871ff004fb21382c236f9bd0f (diff)
downloadpiscine-d732047d6681b1f64f7907d1c0413abdaab76050.tar.gz
piscine-d732047d6681b1f64f7907d1c0413abdaab76050.tar.bz2
piscine-d732047d6681b1f64f7907d1c0413abdaab76050.zip
c03 and begin c04
Diffstat (limited to 'c03/ex03')
-rw-r--r--c03/ex03/ft_strncat.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/c03/ex03/ft_strncat.c b/c03/ex03/ft_strncat.c
new file mode 100644
index 0000000..c28fb38
--- /dev/null
+++ b/c03/ex03/ft_strncat.c
@@ -0,0 +1,29 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_strncat.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2019/07/05 13:02:04 by cacharle #+# #+# */
+/* Updated: 2019/07/05 15:33:07 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+char *ft_strncat(char *dest, char *src, unsigned int nb)
+{
+ unsigned int i;
+ char *dest_end;
+
+ i = 0;
+ while (dest[i] != '\0')
+ i++;
+ dest_end = dest + i;
+ i = 0;
+ while (i < nb && src[i] != '\0')
+ {
+ dest_end[i] = src[i];
+ i++;
+ }
+ return (dest);
+}