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 / dattathreya

The below function should do it:

int strLength(char *s)
{
int i;
for(i = 0; s[i]; i++);
return i;
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a program have two main functions?

1116


What is volatile variable how do you declare it?

1091


What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?

1273


the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above

1041


Explain how do you list files in a directory?

1065


while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above

1236


What does s c mean on snapchat?

1106


What are control structures? What are the different types?

1085


Can we access array using pointer in c language?

1082


What are the difference between a free-standing and a hosted environment?

1284


What is the difference between pure virtual function and virtual function?

1114


What is const keyword in c?

1158


What is the scope of local variable in c?

1120


What are the preprocessor categories?

1055


Explain what is the general form of a c program?

1085