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 is an identifier?
Why enum is used in c?
What is signed and unsigned?
Which is best book for data structures in c?
Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.
Explain Function Pointer?
What is boolean in c?
Simplify the program segment if X = B then C ← true else C ← false
Why #include is used in c language?
Describe dynamic data structure in c programming language?
Where are local variables stored in c?
What is the difference between local variable and global variable in c?
Describe the order of precedence with regards to operators in C.
What is the difference between array and linked list in c?
What are the differences between Structures and Arrays?