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
Are there any problems with performing mathematical operations on different variable types?
Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.
Explain the difference between getch() and getche() in c?
What is a class c rental property?
What are the different types of objects used in c?
Is there anything like an ifdef for typedefs?
How can I change the size of the dynamically allocated array?
Give me the code of in-order recursive and non-recursive.
Is c object oriented?
What standard functions are available to manipulate strings?
please send me the code for multiplying sparse matrix using c
Tell us two differences between new () and malloc ()?
Can you please explain the difference between exit() and _exit() function?
What do you mean by dynamic memory allocation in c? What functions are used?
Explain the use of 'auto' keyword