#include<std.h>
int main()
{
char *str[]={"Frogs","Do","Not","Die","They","Croak!"};
printf("%d %d\n",sizeof(str),strlen(str));
...return 0;
}
what will the output of the above program?
Answers were Sorted based on User's Feedback
hi dear my name is Amit.
firtly i want to ask that you have used std.h. header
file.can u tell me about this one becuouse i am using
stdio.h header file instead of it.it can make an error if
it is not header file.second thing is that you have used
function strln() which is the function of string.h. to use
this function we have to this header file.it will produced
error with out this header file.
#include<stdio.h>
#include<conio.h>
#include<string.h>
main()
{
char *str[]={"Frogs","Do","Not","Die","They","Croak!"};
printf("%d %d\n",sizeof(str),strlen(str));
getch();
}
the out put will be 12 and 1....
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / janava
In this it generate an error because declaration the array
as char but read the variable as integer.
| Is This Answer Correct ? | 7 Yes | 6 No |
Answer / s.ramakrishna
thw output becomes 6 6
why because the character pointer stores their values and
that will be printed
| Is This Answer Correct ? | 4 Yes | 3 No |
Answer / naresh lingampally
will be a error since ..
syn: *x will be a pointer and it would always be a digit .
so no variable address can be a character ...
MAKES SENSE ?
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / kelly baby
Hello dear new friend,
my name is Kelly i read your profile and i decided to
contact you hopping that you will accept me as your friend,
please if you accept my request reply my true my email
address (kellybaby004@yahoo.in) so that i will send you my
picture and tell you more about me, do not late far
decadence be a barrier let love cornet because love is
abridge cornet far decadence to be lose.
yours kelly
| Is This Answer Correct ? | 0 Yes | 3 No |
main difference between c and c++ language
What is the use of getchar() function?
2. Write a function called hms_to_secs() that takes three int values—for hours, minutes, and seconds—as arguments, and returns the equivalent time in seconds.. Create a program that exercises this function by repeatedly obtaining a time value in hours, minutes, and seconds from the user (format 12:59:59), calling the function, and displaying the value of seconds it returns.
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }
Explain the difference between exit() and _exit() function?
Why do we use main function?
a simple c program using 'for' loop to display the output 5 4 3 2 1
What does %p mean c?
what is difference between array of characters and string
What is logical error?
Write a program to reverse a string.
0 Answers Global Logic, iNautix, TCS, Wipro,