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

Explain how do you sort filenames in a directory?

1077


What are nested functions in c?

1074


What are void pointers in c?

1062


explain what are actual arguments?

1144


which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above

1784


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

1394


How can I ensure that integer arithmetic doesnt overflow?

1255


How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?

16923


What is a keyword?

1221


Why we use conio h in c?

1304


What does the message "automatic aggregate intialization is an ansi feature" mean?

1245


What do you know about the use of bit field?

1100


What does c mean?

1108


Why static is used in c?

1146


What are volatile variables in c?

997