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 is %d called in c?

850


When can a far pointer be used?

674


Does c have class?

704


write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.

1665


praagnovation

1883






write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?

2526


Explain what is the benefit of using const for declaring constants?

695


What does double pointer mean in c?

675


application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above

709


what will be the output for the following main() { printf("hi" "hello"); }

9708


in iso what are the common technological language?

1722


Is it cc or c in a letter?

662


How is a structure member accessed?

690


what type of questions arrive in interview over c programming?

1648


Why is C language being considered a middle level language?

742