Whats wrong with the following function
char *string()
{
char *text[20];
strcpy(text,"Hello world");
return text;
}
Answer Posted / qint
1. returning address of a local variable.
2. wrong parameter passed to strcpy()
Is This Answer Correct ? | 4 Yes | 5 No |
Post New Answer View All Answers
What do you mean by keywords in c?
What is NULL pointer?
How can I read and write comma-delimited text?
What does the file stdio.h contain?
What are the advantages and disadvantages of c language?
Explain void pointer?
Tell me when is a void pointer used?
can any one tel me wt is the question pattern for NIC exam
why use "return" statement a) on executing the return statement it immediately transfers the control back to the calling program b) it returns the value present in the parentheses return, to the calling program c) a & b d) none of the above
If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.
What is variable and explain rules to declare variable in c?
Tell us two differences between new () and malloc ()?
Explain what is the most efficient way to store flag values?
What does %d do in c?
I came across some code that puts a (void) cast before each call to printf. Why?