/*
Date: 17/08/13 08:46
Description: This is developed as an alternatove to string functions present in standered library
*/
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int stringlen(char *); //return the lenght of the string
int main()
{
char str[]="\0";
int k=0;
printf("enter your string:");
gets(str);
//scanf("%s",str);
k=stringlen(str);
printf("string lenght=%d",k);
return 0;
}
int stringlen(char *temp)
{
int count=0;
while(*temp) count++,temp++;
return(count);
}
Date: 17/08/13 08:46
Description: This is developed as an alternatove to string functions present in standered library
*/
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int stringlen(char *); //return the lenght of the string
int main()
{
char str[]="\0";
int k=0;
printf("enter your string:");
gets(str);
//scanf("%s",str);
k=stringlen(str);
printf("string lenght=%d",k);
return 0;
}
int stringlen(char *temp)
{
int count=0;
while(*temp) count++,temp++;
return(count);
}
No comments:
Post a Comment