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

Why isnt there a numbered, multi-level break statement to break out

1100


What are the disadvantages of external storage class?

1105


What is a pointer on a pointer in c programming language?

1190


What is logical error?

1190


What is structure pointer in c?

1091


What does the message "automatic aggregate intialization is an ansi feature" mean?

1243


What is the heap in c?

1125


What should malloc() do?

1220


What is a sequential access file?

1245


When should a type cast be used?

1065


What's the total generic pointer type?

1109


How do you declare a variable that will hold string values?

1231


Is c call by value?

1079


When do we get logical errors?

1175


Is null valid for pointers to functions?

1251