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
in linking some of os executables are linking name some of them
What is return type in c?
What is pointer and structure in c?
How can you check to see whether a symbol is defined?
What does p mean in physics?
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question
Is main is a keyword in c?
What is c token?
Explain how do you determine a file’s attributes?
What is a 'null pointer assignment' error?
how to find anagram without using string functions using only loops in c programming
Study the following C program :call_me (myvar)int myvar;{ myvar +- 5; }main(){int myvar;myvar = 3;call_me(myvar);printf("%d ",myvar);What will be printed a) 3 b) 5 c) 8 d) symbol
If null and 0 are equivalent as null pointer constants, which should I use?
How #define works?
the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function