제가 이제 C언어 기초공부 시작했는데요
#include <stdio.h>
my_strlen(char *s)
{
char *p = s;
while(*p)
p++;
return(p-s);
}
main()
{
char p[10] = "Kim";
printf("length of \"kim\" is %d\n",my_strlen(p));
}
이거랑
#include <stdio.h>
void my_strcpy(char *s,char *t)
{
while((*s++ = *t++));
}
main()
{
char *x = "Kim";
char y[10];
my_strcpy(y,x);
printf("%s %s\n",x,y);
}
이거랑
#include <stdio.h>
#include <string.h>
void my_strcat(char s[],char t[])
{
int i,j;
i = j = 0;