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
Can a program have two main functions?
What is volatile variable how do you declare it?
What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?
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
Explain how do you list files in a directory?
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
What does s c mean on snapchat?
What are control structures? What are the different types?
Can we access array using pointer in c language?
What are the difference between a free-standing and a hosted environment?
What is the difference between pure virtual function and virtual function?
What is const keyword in c?
What is the scope of local variable in c?
What are the preprocessor categories?
Explain what is the general form of a c program?