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

void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply

0 Answers  


what is array?

63 Answers   Amdocs, HCL,


I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.

0 Answers   TCS,


what is difference between array and structure?

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


What is c token?

0 Answers  


WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..

0 Answers  


write an algorithm to display a square matrix.

0 Answers  


What is a function simple definition?

0 Answers  


write a program to print calender using for loop.

1 Answers   HCL, TCS,


code snippet for creating a pyramids triangle ex 1 2 2 3 3 3

4 Answers  


What are the general description for loop statement and available loop types in c?

0 Answers  


What is a char in c?

0 Answers  


Categories