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
a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above
What are loops in c?
How can you be sure that a program follows the ANSI C standard?
write a c program in such a way that if we enter the today date the output should be next day's date.
How can I run c program?
ATM machine and railway reservation class/object diagram
largest Of three Number using without if condition?
Explain 'far' and 'near' pointers in c.
Explain what is meant by 'bit masking'?
Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon
Explain continue keyword in c
How do you sort filenames in a directory?
Explain the difference between structs and unions in c?
#include main() { int *p, *c, i; i = 5; p = (int*) (malloc(sizeof(i))); printf(" %d",*p); *p = 10; printf(" %d %d",i,*p); c = (int*) calloc(2); printf(" %d ",*c); }
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none