View difference between Paste ID: 5gegMiSx and M348rHfg
SHOW: | | - or go back to the newest paste.
1
/*   Writing own version of the "   strlen( )   "  library function which is named mystrlen( )   */    
2
#include<stdio.h>
3
int mystrlen(char a[]);
4
int main(void)
5
{
6
    char a[999999];
7
    gets(a);
8
    int x=mystrlen(a);
9
    printf("%d",x);
10
    return 0;
11
}
12
int mystrlen(char a[])
13
{
14
    int i,counter=0;
15
    for(i=0;a[i]!='\0';i++)
16
    {
17
        counter++;
18
    }
19
    return counter;
20
}