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(*p)
{
p=(char *)malloc(6);
p="hello";
return;
}
main()
{
char *p="bye";
f(p);
printf("%s",p);
}
what is the o/p?

Answers were Sorted based on User's Feedback



f(*p) { p=(char *)malloc(6); p="hello"; return; } main() { ..

Answer / fazlur rahaman naik

actually the above programme produces an error.because u've
to mention which type of pointer it is at fuction f(*p).
i.e f(char *p).
if u correct this error.then the out put will be
bye

Is This Answer Correct ?    4 Yes 1 No

f(*p) { p=(char *)malloc(6); p="hello"; return; } main() { ..

Answer / yellareddy

After removing the error, the output is "bye"

Is This Answer Correct ?    0 Yes 0 No

f(*p) { p=(char *)malloc(6); p="hello"; return; } main() { ..

Answer / subbu

after correction of error, the output will be hello

Is This Answer Correct ?    1 Yes 2 No

f(*p) { p=(char *)malloc(6); p="hello"; return; } main() { ..

Answer / vrushali

The answer is bye...

Is This Answer Correct ?    1 Yes 2 No

f(*p) { p=(char *)malloc(6); p="hello"; return; } main() { ..

Answer / hussain reddy

hello

Is This Answer Correct ?    0 Yes 1 No

f(*p) { p=(char *)malloc(6); p="hello"; return; } main() { ..

Answer / madhureddy

the answer is bye

Is This Answer Correct ?    0 Yes 1 No

f(*p) { p=(char *)malloc(6); p="hello"; return; } main() { ..

Answer / vignesh1988i

bye

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More C Interview Questions

When should a type cast not be used?

0 Answers  


When was c language developed?

0 Answers  


write a program for odd numbers?

15 Answers  


How many types of operator or there in c?

0 Answers  


What is #include stdlib h?

0 Answers  


What is a keyword?

0 Answers  


What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.

0 Answers  


52.write a “Hello World” program in “c” without using a semicolon? 53.Give a method to count the number of ones in a 32 bit number? 54.write a program that print itself even if the source file is deleted? 55.Given an unsigned integer, find if the number is power of 2?

25 Answers   Datamatics, Solartis, TCS, ThinkBox, Trine,


void main() { int *ptr; ptr = (int *) 0x400 ; printf("ptr=%d",ptr); } output?

1 Answers  


what is difference between array and structure?

44 Answers   College School Exams Tests, CTS, Google, HCL, IBM, Motorola, TCS,


How are pointers declared in c?

0 Answers  


What is bash c?

0 Answers  


Categories