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

The out put is "BYE".
Because the pointer p dies when function exit with out
return,in main pointer p points to only "BYE",so prinf
prints which p points in main.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the 32 keywords in c?

1090


How do you initialize pointer variables?

1092


What are examples of structures?

1102


Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.

1399


Why main function is special give two reasons?

1537


What is meant by type specifiers?

1128


Explain union. What are its advantages?

1075


What is difference between class and structure?

1114


What is a pointer in c plus plus?

1298


Is javascript based on c?

1061


Explain how do you sort filenames in a directory?

1036


What is a #include preprocessor?

1145


please give me some tips for the placement in the TCS.

2108


What are external variables in c?

1098


A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.

1712