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
What is s in c?
What is fflush() function?
Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.
What are the types of macro formats?
What does typeof return in c?
How many types of arrays are there in c?
Where is volatile variable stored?
What is operator precedence?
Explain what are global variables and explain how do you declare them?
What is zero based addressing?
What is a program flowchart and explain how does it help in writing a program?
Explain how do you print only part of a string?
What is NULL pointer?
What is meant by 'bit masking'?
Describe newline escape sequence with a sample program?