f(char *p)
{
p=(char *)malloc(sizeof(6));
strcpy(p,"HELLO");
}
main()
{
char *p="BYE";
f(p)
printf("%s",p);
}
what is the output?

Answer Posted / deepa

SOORY FOR POSTIN THE WRONG ANSWER THE ANSER WUD BE BYE COZ
THE *P DIES IN THE FUNCTION ITSELF AS WE ARE NOT RETURNING
THE STRING BACK IN THE MAIN PROGRAM

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is s in c?

814


What is fflush() function?

864


Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.

935


What are the types of macro formats?

781


What does typeof return in c?

811






How many types of arrays are there in c?

760


Where is volatile variable stored?

820


What is operator precedence?

852


Explain what are global variables and explain how do you declare them?

814


What is zero based addressing?

889


What is a program flowchart and explain how does it help in writing a program?

937


Explain how do you print only part of a string?

890


What is NULL pointer?

842


What is meant by 'bit masking'?

1084


Describe newline escape sequence with a sample program?

858