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 / anu
the output wll be hello , since the argument is overwritten
with new memory in the function.
so in main, when it comes to printf, p points to the
allocatd memory, which contains hello
Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
Do you have any idea about the use of "auto" keyword?
What is #ifdef ? What is its application?
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
What is #line in c?
Explain what is the advantage of a random access file?
What are the 4 types of organizational structures?
What is c system32 taskhostw exe?
disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit
How is actual parameter different from the formal parameter?
How many identifiers are there in c?
How to write a code for implementing my own printf() and
scanf().... Please hep me in this... I need a guidance...
Can you give an coding for c... Please also explain about
the header files used other than #include
What is the use of the function in c?
How are variables declared in c?
What is the significance of scope resolution operator?
Where are c variables stored in memory?