how to find string length wihtout using c function?

Answer Posted / ankitecian

int StrLen(const char *_input)
{
int _len = 0;
while( *(_input + _len) != NULL)
{
_len++;
}
return _len;
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is better oop or procedural?

832


What is a double c?

789


What is the difference between malloc() and calloc() function in c language?

840


What are the three constants used in c?

749


What is the difference between a string and an array?

942


in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above

823


which type of aspect you want from the student.

1924


When can you use a pointer with a function?

770


What does c mean in standard form?

878


if p is a string contained in a string?

1637


#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }

924


Is it acceptable to declare/define a variable in a c header?

890


Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].

892


How do you print only part of a string?

800


Is c still used?

817