Write a function int mystrlen(char *s) that returns the number of characters in a string wuthout str

Posted by henry on Stack Overflow See other posts from Stack Overflow or by henry
Published on 2009-12-03T07:07:51Z Indexed on 2010/03/13 7:05 UTC
Read the original article Hit count: 199

Filed under:
|

heres what i did, i just have ne error that i cant figure out.

int mystrlen(char string[])
{
 char string1[LENGHT], string2[LENGHT];
 int len1, len2;
 char newstring[LENGHT*2];

 printf("enter first string:\n");
 len1 = mystrlen(string1);
 printf("enter second string:\n");
 len2 = mystrlen(string2);

 if(len1 == EOF || len2 == EOF)
  exit(1);

 strcpy(newstring, string1);
 strcat(newstring, string2);

 printf("%s\n", newstring);

 return 0;

© Stack Overflow or respective owner

Related posts about c

    Related posts about homework