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 is auto keyword in c?

0 Answers  


Is that possible to store 32768 in an int data type variable?

0 Answers  


What is true about the following C Functions a.Need not return any value b.Should always return an integer c.Should always return a float d.Should always return more than one value.

11 Answers   TCS,


Define the scope of static variables.

0 Answers  


What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?

0 Answers   Aspire, Infogain,


void main() { //char ch; unsigned char ch; clrscr(); for(ch =0;ch<= 127; ch++) printf(" %c= %d \t ", ch, ch); } output?

4 Answers   Groupon,


What is line in c preprocessor?

0 Answers  


what is the diference between pointer to the function and function to the pointer?

2 Answers   Infosys,


Define a structure to store the record of library. The record must consist of at least following fields: Title, Author, Edition, Price, Publisher, and Category. -Define functions authorSearch ( ), TitleSearch ( ) and CategorySearch ( ) to search a book with respect to author, title and category. [There can be more than one book, written by one author, in one category]

2 Answers  


what is recursion in C

0 Answers   Cap Gemini,


Sir i need notes for structure,functions,pointers in c language can you help me please

0 Answers   TCS,


can a union be self-referenced?

1 Answers  


Categories