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 variable declaration and definition in c?
Explain a pre-processor and its advantages.
How will you declare an array of three function pointers where each function receives two ints and returns a float?
What are different storage class specifiers in c?
What is queue in c?
Is c is a procedural language?
What are the various types of control structures in programming?
Should I learn data structures in c or python?
In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.
Explain how are 16- and 32-bit numbers stored?
What is the use of pragma in embedded c?
What is the general form of a C program?
When should you use a type cast?
What is huge pointer in c?
What is the default value of local and global variables in c?