a memory of 20 bytes is allocated to a string declared as
char *s then the following two statements are executed:
s="Etrance"
l=strlen(s);
what is the value of l ?
a.20
b.8
c.9
d.21
Answers were Sorted based on User's Feedback
Answer / fazlur rahaman naik
the string is Entrance or Etrance?
if it is Entrance,then only the answer is here.
b is the right answer.
because string length means it will count only the no.of
characters in that string only...not the null character.
| Is This Answer Correct ? | 23 Yes | 1 No |
Answer / subbu
l=7 is the right answer, which is not given in the options.
| Is This Answer Correct ? | 10 Yes | 8 No |
Answer / valli
20 bytes of memory is allocated to s
hence
l=strlen(s);//l=20
so answer is a
| Is This Answer Correct ? | 2 Yes | 14 No |
Answer / sivasankar.a
the answer is c)9 because of "etrance"this word lengh is 9.
| Is This Answer Correct ? | 3 Yes | 19 No |
what is meant by c
What is function pointer and where we will use it
What is alloca() and why is its use discouraged?
Can a void pointer point to a function?
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
What is an array in c?
Which is the memory area not included in C program? give the reason
What is the difference between %d and %*d in C
What are the complete rules for header file searching?
how can i include my own .h file EX:- alex.h like #include<alex.h>, rather than #include"alex.h"
Dear Sir, we are required the bubble sorting programs Regs Prem
write a program to copy the string using switch case?