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

the outpu is hello coz the pointer is pointing to a
location where the string "bye" is written in the next
program yu are using the same pointer to point to some
other string so it gets overwritten

Is This Answer Correct ?    2 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is wrong with this statement? Myname = 'robin';

1327


What is the difference between malloc() and calloc() function in c language?

1081


List the different types of c tokens?

1074


Explain the use of 'auto' keyword

1125


Why c is called object oriented language?

1072


Write program to remove duplicate in an array?

1084


How can I change their mode to binary?

1121


What is use of null pointer in c?

1017


can any one tel me wt is the question pattern for NIC exam

1990


What is ctrl c called?

1050


How can you call a function, given its name as a string?

1159


What is meant by high-order and low-order bytes?

1051


What is indirection? How many levels of pointers can you have?

1145


What is the use of header files?

1114


What is a sequential access file?

1179