forked from 131/lab3_test
22 lines
422 B
C
22 lines
422 B
C
#include <stdio.h>
|
|
#include "str_lib.h"
|
|
|
|
int
|
|
main(int argc, const char *argv[])
|
|
{
|
|
const char *s1 = "hello";
|
|
const char *s2 = "ello";
|
|
|
|
if (argc > 2) {
|
|
s1 = argv[1];
|
|
s2 = argv[2];
|
|
}
|
|
|
|
// binary for manual testing
|
|
printf("\033[1;30mUse str_test for actual testing\033[0m\n");
|
|
|
|
printf("mystrlen(\"%s\") == %d\n", s1, mystrlen(s1));
|
|
printf("str_idx(\"%s\", \"%s\") == %d\n", s1, s2, mystr_idx(s1, s2));
|
|
return 0;
|
|
}
|