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 / prasad

it prints BYE on screen!!!

Is This Answer Correct ?    15 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is typeof in c?

748


Define Array of pointers.

816


How can I convert a number to a string?

795


what is recursion in C

796


find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2

1715






Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..

823


Describe wild pointers in c?

825


Can you please compare array with pointer?

803


What is a class c rental property?

833


program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)

1843


What are structure types in C?

836


Write a program to generate random numbers in c?

837


Explain how do I determine whether a character is numeric, alphabetic, and so on?

865


illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question

1817


is it possible to create your own header files?

809