27 lines
839 B
C
27 lines
839 B
C
#include "libasm.h"
|
|
#include <stdlib.h>
|
|
|
|
int main() {
|
|
char my_string[37] = "c'est moi la chaine de 36 caracteres";
|
|
printf("%ld\n", ft_strlen(my_string));
|
|
|
|
char *str;
|
|
str = (char *)malloc(150 * sizeof(char));
|
|
str = "Salut c'est moi la zone mdr\0";
|
|
char *dst;
|
|
dst = (char *)malloc(50 * sizeof(char));
|
|
char *test = ft_strcpy(dst, str);
|
|
printf("%s\n", str);
|
|
printf("%s\n", dst);
|
|
printf("%s\n", test);
|
|
printf("should be 0: %d\n", ft_strcmp(str, dst));
|
|
printf("should be 0 and not segv: %d\n", ft_strcmp(dst, test));
|
|
printf("should be 16 %d\n", ft_strcmp(my_string, str));
|
|
printf("should be -16 %d\n", ft_strcmp(str, my_string));
|
|
dst = "Salut c'est moi la diff mdr\0";
|
|
printf("should be 22: %d\n", ft_strcmp(str, dst));
|
|
dst = "Salut\0 c'est moi la diff mdr\0";
|
|
printf("should be 32: %d\n", ft_strcmp(str, dst));
|
|
return 0;
|
|
}
|