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

what wud be the output? main() { char *str[]={ "MANISH" "KUMAR" "CHOUDHARY" }; printf("\nstring1=%s",str[0]); printf("\nstring2=%s",str[1]); printf("\nstring3=%s",str[2]); a)string1=Manish string2=Kumar string3=Choudhary b)string1=Manish string2=Manish string3=Manish c)string1=Manish Kumar Choudhary string2=(null) string3=(null) d)Compiler error

9 Answers   Infosys,


Program to find larger of the two numbers without using if-else,while,for,switch

11 Answers   iNautix, Wipro,


Write a program to print numbers from 1 to 100 without using loop in c?

0 Answers  


how to connect oracle in C/C++.

3 Answers   TCS, Wipro,


What are the disadvantages of a shell structure?

0 Answers  


Why c is faster than c++?

0 Answers  


how to find that no is int or float?

5 Answers  


How can you call a function, given its name as a string?

0 Answers  


What is a segmentation fault?

2 Answers  


Is flag a keyword in c?

0 Answers  


can any one provide me the notes of data structure for ignou cs-62 paper

0 Answers   Ignou,


Why is python slower than c?

0 Answers  


Categories