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

Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?

1114


An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode

1103


which is an algorithm for sorting in a growing Lexicographic order

1817


my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?

1596


How does normalization of huge pointer works?

1182


c program to compute AREA under integral

2415


When can you use a pointer with a function?

1093


What is assignment operator?

1066


int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer

1046


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

1158


please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code

2193


how do you execute a c program in unix.

1123


C language questions for civil engineering

1728


how to find anagram without using string functions using only loops in c programming

3203


Explain what are reserved words?

1116