Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to generate the length of a string without using len
funtion?

Answer Posted / shruti

** same as above.. only u should initialise the valued of
varibale len to 0..
otherwise it will pick up some garbage value.. **


int strlength(char s[])
{
int i , len;

len = 0;
for(i = 0 ; s[i] != '/0' ; i++)
{
len++;
}

return len;
}

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the 5 types of inheritance in c ++?

1027


What is c basic?

1182


my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?

1590


What is realloc in c?

1120


Explain how do you print an address?

1146


What are the loops in c?

999


List a few unconditional control statement in c.

989


where are auto variables stored? What are the characteristics of an auto variable?

1076


What is this pointer in c plus plus?

1094


How do you define structure?

1047


What are different types of pointers?

1075


Which header file is essential for using strcmp function?

1487


In C language, a variable name cannot contain?

1279


What is the collection of communication lines and routers called?

1129


Do pointers take up memory?

1165