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
Can you please compare array with pointer?
please explain every phase in the "SDLC" in the dotnet.
Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?
What are the types of bitwise operator?
What is the best style for code layout in c?
What is #error and use of it?
What is structure and union in c?
Why do we use pointer to pointer in c?
Write a Program to find whether the given number or string is palindrome.
What’s a signal? Explain what do I use signals for?
Are the outer parentheses in return statements really optional?
How do I convert a string to all upper or lower case?
Why is c so important?
What are identifiers in c?
What is a good way to implement complex numbers in c?