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
What are the 5 types of inheritance in c ++?
What is c basic?
my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?
What is realloc in c?
Explain how do you print an address?
What are the loops in c?
List a few unconditional control statement in c.
where are auto variables stored? What are the characteristics of an auto variable?
What is this pointer in c plus plus?
How do you define structure?
What are different types of pointers?
Which header file is essential for using strcmp function?
In C language, a variable name cannot contain?
What is the collection of communication lines and routers called?
Do pointers take up memory?