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


Please Help Members By Posting Answers For Below Questions

What are the two forms of #include directive?

646


What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25

1494


Is c dynamically typed?

671


Explain main function in c?

630


Explain high-order bytes.

678






How can I send mail from within a c program?

583


Write a program to print factorial of given number without using recursion?

573


What is hungarian notation? Is it worthwhile?

703


a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above

659


Tell me about low level programming languages.

649


What is ponter?

777


Write a program to identify if a given binary tree is balanced or not.

689


Why c is called top down?

632


When should we use pointers in a c program?

636


Describe how arrays can be passed to a user defined function

788