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
Which is better oop or procedural?
What is a double c?
What is the difference between malloc() and calloc() function in c language?
What are the three constants used in c?
What is the difference between a string and an array?
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
which type of aspect you want from the student.
When can you use a pointer with a function?
What does c mean in standard form?
if p is a string contained in a string?
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
Is it acceptable to declare/define a variable in a c header?
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 ].
How do you print only part of a string?
Is c still used?