Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is getch() function?

1109


What does sizeof function do?

1257


What is binary tree in c?

1138


Can a program have two main functions?

1179


What functions are used in dynamic memory allocation in c?

1122


What are enums in c?

1289


What does c mean in standard form?

1246


`write a program to display the recomended action depends on a color of trafic light using nested if statments

2182


What is the heap?

1261


What is use of null pointer in c?

1060


Explain how can you determine the size of an allocated portion of memory?

1152


Explain what is a pragma?

1092


What is the best way of making my program efficient?

1084


What is spark map function?

1210


What is meant by type specifiers?

1188