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 the curly brackets { } be used to enclose a single line of code?
What are the applications of c language?
What are the functions to open and close file in c language?
while initialization of array why we use a[][2] why not a[2][]...?
What are the advantages of using new operator as compared to the function malloc ()?
What is c programing language?
What is variables in c?
What are the difference between a free-standing and a hosted environment?
What is a newline escape sequence?
main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }
What is the use of header?
write a c program to do the following: a) To find the area of a triangle. b) To convert the temperature from Fahrenheit to Celsius. c) To convert the time in hours : minutes : seconds to seconds.
int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer
What are the advantages of external class?
What is a memory leak? How to avoid it?