c_piscine__offshore_mains/c02/ex00.c
Aleksei Chubukov 92b42aa8ec add c02/ex00
2023-11-23 22:26:57 +04:00

26 lines
735 B
C

#include "common.c"
char *ft_strcpy(char *dest, char *src);
int main(void)
{
char s1[100] = TEST_SOURCE;
char d1[100] = TEST_DESTINATION;
char s2[100] = TEST_SOURCE;
char d2[100] = TEST_DESTINATION;
char* r1, *r2;
printf("initial strings:\n");
dump(s1, TEST_SOURCE_LENGHT);
dump(d1, TEST_DESTINATION_LENGHT);
r1 = strcpy(d1 ,s1);
printf("strcpy:\n");
dump(s1, TEST_SOURCE_LENGHT);
dump(d1, TEST_DESTINATION_LENGHT);
r2 = ft_strcpy(d2, s2);
printf("ft_strcpy:\n");
dump(s2, TEST_SOURCE_LENGHT);
dump(d2, TEST_DESTINATION_LENGHT);
printf("buffers comparison: s:%i d:%i\n", bufcmp(s1, s2, TEST_SOURCE_LENGHT), bufcmp(d1, d2, TEST_DESTINATION_LENGHT));
printf("return values comparison: %li %li", d1 - r1, d2 - r2);
}