int main(){ char *s = "chehat"; char *t = "hat"; char *p = mon_strstr(s,t); printf("%p %p\n",p,&s[3]); char ss[10] = "aaa"; char *pp = mon_strcat(ss,t); printf("%s\n",pp); return 0; }
int main() { char s[] = "toto"; printf("%d\n", mon_strlen(s)); char s1[20] = "abce"; char s2[] = "abcd"; printf("%d\n", mon_strcmp(s1, s2)); printf("%d\n", mon_strncmp(s1, s2, 3)); printf("%s + %s = %s \n", s1, s2, mon_strcat(s1, s2)); printf("%c\n", *mon_strchr(s, 'o')); char str[] = "abcdef"; char substr[] = "cd"; printf("%s\n", mon_strstr(str, substr)); return 0; }
MU_TEST(mon_strcat, mon_strcat_a_b_vide) { char *result ; strcpy(dest, "PREM") ; result = mon_strcat(dest, "") ; MU_ASSERT_EQUAL(strcmp(result,"PREM"), 0) ; }
MU_TEST(mon_strcat, mon_strcat_a_vide_et_b) { char *result ; strcpy(dest, "") ; result = mon_strcat(dest, "IJKLM") ; MU_ASSERT_EQUAL(strcmp(result,"IJKLM"), 0) ; }