Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | ** EPITECH PROJECT, 2023 | ||
3 | ** my_strcpy | ||
4 | ** File description: | ||
5 | ** Copy a string (src) and paste it on another string (dest) | ||
6 | */ | ||
7 | /** | ||
8 | * @file my_strcpy.c | ||
9 | * @brief The file containing the my_strcpy function | ||
10 | * @author Nicolas TORO | ||
11 | */ | ||
12 | |||
13 | #include "my.h" | ||
14 | |||
15 | 15 | char *my_strcpy(char *dest, char const *src) | |
16 | { | ||
17 | 15 | int i = 0; | |
18 | |||
19 |
2/2✓ Branch 0 taken 41 times.
✓ Branch 1 taken 15 times.
|
56 | while (src[i] != '\0') { |
20 | 41 | dest[i] = src[i]; | |
21 | 41 | i = i + 1; | |
22 | } | ||
23 | 15 | dest[i] = '\0'; | |
24 | 15 | return dest; | |
25 | } | ||
26 |