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 1f in c?

2647


What tq means in chat?

1120


Do you know the use of 'auto' keyword?

1191


Is anything faster than c?

1010


write a c program to calculate sum of digits till it reduces to a single digit using recursion

3306


Describe wild pointers in c?

1108


In which language linux is written?

1224


What is multidimensional arrays

1120


How can I automatically locate a programs configuration files in the same directory as the executable?

1162


Can a local variable be volatile in c?

987


What are the 4 types of functions?

1050


Explain how can you tell whether a program was compiled using c versus c++?

1101


why use "return" statement a) on executing the return statement it immediately transfers the control back to the calling program b) it returns the value present in the parentheses return, to the calling program c) a & b d) none of the above

1074


Difference between exit() and _exit() function?

1132


What is quick sort in c?

1083