#include <string.h>
main()
{
	char *a = "hi dave go homey";
	char *a1 = "hi dave go homeZ";
	char *b = "1";
	char *c = "12";
	char *d = "123";
	char *e = "1234";	
	char buf[33];
#ifdef XXXXX
	printf("%s\n", strchr(a, 'h'));
	printf("%s\n", strchr(a, 'y'));
	printf("%s\n", strchr(a, 'd'));
	printf("%s\n", strchr(a, 'z'));
	printf("%s\n", memchr(a, 'h', 15));
	printf("%s\n", memchr(a, 'i', 15));
	printf("%s\n", memchr(a, ' ', 15));
	printf("%s\n", memchr(a, 'd', 15));
	printf("%s\n", memchr(a, 'm', 15));
	printf("%s\n", memchr(a, 'd', 3));
	printf("%s\n", memchr(a, 'd', 4));
	printf("%d\n", memcmp(a,a1,15));
	printf("%d\n", memcmp(a,a1,16));
	printf("%d\n", memcmp(a1,a,16));
	buf[32] = 0;
	memset(buf, 'a',32);
	printf("%s\n", 	buf);
	memset(buf+1, 'b',30);
	printf("%s\n", 	buf);
	memset(buf+2, 'c',28);
	printf("%s\n", 	buf);
	memset(buf+3, 'd',26);
	printf("%s\n", 	buf);
	memcpy(buf, a+1, 15);
	printf("%s\n", 	buf);
	memcpy(buf+1, a+1, 15);
	printf("%s\n", 	buf);
	memcpy(buf+2, a+1, 15);
	printf("%s\n", 	buf);
	memcpy(buf+3, a+1, 15);
	printf("%s\n", 	buf);
	printf("\n");
	memmove(buf, buf+1, 31);
	printf("%s\n", 	buf);
	memmove(buf+1, buf, 31);
	printf("%s\n", 	buf);

	strcpy(buf, a1);
	printf("%s\n", 	buf);
	strcpy(buf+1, d);
	printf("%s\n", 	buf);
	strcpy(buf, a1);
	strcat(buf+1, d);
	printf("%s\n", buf);
	buf[32] = 0;
	memset(buf, '-',32);
	strncpy(buf + 4, a, 5);
	printf("%s\n", buf);
	strncpy(buf, d, 10);
	buf[strlen(d)] = 'p';
	printf("%s\n", buf);
	strncpy(buf, d, 10);
	printf("%s\n", buf);
	memset(buf, 0, sizeof(buf));
	strcpy(buf, d);
	strncat(buf, a, 5);
	printf("%s\n", buf);
	strncat(buf,d, 10);
	printf("%s\n", buf);
	printf("%d\n", strncmp(a, a1, 15));
	printf("%d\n", strncmp(a, a1, 16));
	printf("%d\n", strncmp(a1, a, 16));
	printf("%s\n", strstr(a, "dave"));
	printf("%s\n", strstr(a, "hi"));
	strcpy(buf, a);
	printf("%d\n", 	stpcpy(buf, d) - buf);
	buf[32] = 0;
	memset(buf, '-',32);
	stpncpy(buf + 4, a, 5);
	printf("%d\n", stpncpy(buf+4, a, 5) - buf);
	printf("%s\n", buf);
	stpncpy(buf, d, 10);
	buf[strlen(d)] = 'p';
	printf("%s\n", buf);
	stpncpy(buf, d, 10);
	printf("%s\n", buf);
	printf("%d\n", stpncpy(buf, d, 10) - buf);
	printf("%d\n", strspn("hello123","1234567890"));
	printf("%d\n", strspn("hello123","hello"));
	printf("%d\n", strcspn("hello123","1234567890"));
	printf("%d\n", strcspn("hello123","ello"));
	printf("%s\n", strpbrk("hello123","asdfh"));
	printf("%s\n", strpbrk("hello123","asdfo"));
	printf("%s\n", strpbrk("hello123","asdf3"));
	printf("%s\n", strpbrk("hello123","asdf9"));
	
	printf("%s\n", strrchr("hello123", 'o'));
	printf("%s\n", strrchr("hello123", '0'));
	printf("%s\n", strrchr("hello123", 'l'));
	printf("%s\n", strchr("hello123", 'l'));

	printf("%d\n", strcmp(a+1,a+1));
	printf("%d\n", strcmp(a+1,a1+1));
	printf("%d\n", strcmp(a1+1,a+1));
	printf("%d\n", strcmp(b+1,c+1));
	printf("%d\n", strcmp(c+1,b+1));
	printf("\n");
	printf("%d\n", strncmp(a+1, a1+1, 15));
	printf("%d\n", strncmp(a+1, a1+1, 16));
	printf("%d\n", strncmp(a1+1, a+1, 16));

	printf("%d\n",strlen(a));
	printf("%d\n",strlen(a+1));
	printf("%d\n",strlen(a+2));
	printf("%d\n",strlen(a+3));
	printf("%d\n",strlen(a+4));
	printf("%d\n",strlen(b));
	printf("%d\n",strlen(c));
	printf("%d\n",strlen(d));
	printf("%d\n",strlen(e));

	printf("%d\n", memcmp(a,a1,15));
	printf("%d\n", memcmp(a,a1,16));
	printf("%d\n", memcmp(a1,a,16));
	memset(buf, 0, 33);
	memset(buf, 'a', 32);
	memcpy(buf, "hello", 5);
	printf("%d %s\n", strlen(buf), buf);
#endif
	printf("%d\n", strncmp(a, a, 100));
	printf("%d\n", strncmp(a, a1, 100));
	printf("%d\n", strncmp(a1, a, 100));
	printf("%d\n", strncmp(a, d, 100));
	printf("%d\n", strncmp(d, a, 100));
	printf("$%s%s%s$\n", "v","hi","b");		   
}