Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Writing own version of the " strlen( ) " library function which is named mystrlen( ) */
- #include<stdio.h>
- int mystrlen(char a[]);
- int main(void)
- {
- char a[999999];
- gets(a);
- int x=mystrlen(a);
- printf("%d",x);
- return 0;
- }
- int mystrlen(char a[])
- {
- int i,counter=0;
- for(i=0;a[i]!='\0';i++)
- {
- counter++;
- }
- return counter;
- }
Add Comment
Please, Sign In to add comment