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 / hussain reddy

BYE

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you subtract pointers from each other? Why would you?

535


Write program to remove duplicate in an array?

579


What is substring in c?

615


Explain built-in function?

568


Explain union. What are its advantages?

594






Describe the order of precedence with regards to operators in C.

615


In a header file whether functions are declared or defined?

609


to find the closest pair

1802


the question is that what you have been doing all these periods (one year gap)

1600


why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???

1491


Why is c called c?

594


I just typed in this program, and it is acting strangely. Can you see anything wrong with it?

529


What are the preprocessor categories?

610


What is memory leak in c?

604


Is it possible to initialize a variable at the time it was declared?

728