ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
f(*p)
   {
   p=(char *)malloc(6);
   p="hello";
   return;
   }
   main()
   {
   char *p="bye";
   f(p);
   printf("%s",p);
   }
   what is the o/p?
 Question Submitted By :: Harish
I also faced this Question!!     Rank Answer Posted By  
 
  Re: f(*p) { p=(char *)malloc(6); p="hello"; return; } main() { char *p="bye"; f(p); printf("%s",p); } what is the o/p?
Answer
# 1
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 ?    1 Yes 0 No
Fazlur Rahaman Naik
 
  Re: f(*p) { p=(char *)malloc(6); p="hello"; return; } main() { char *p="bye"; f(p); printf("%s",p); } what is the o/p?
Answer
# 2
after correction of error, the output will be hello
 
Is This Answer Correct ?    0 Yes 0 No
Subbu
 
 
 
  Re: f(*p) { p=(char *)malloc(6); p="hello"; return; } main() { char *p="bye"; f(p); printf("%s",p); } what is the o/p?
Answer
# 3
The answer is bye...
 
Is This Answer Correct ?    0 Yes 0 No
Vrushali
 
  Re: f(*p) { p=(char *)malloc(6); p="hello"; return; } main() { char *p="bye"; f(p); printf("%s",p); } what is the o/p?
Answer
# 4
bye
 
Is This Answer Correct ?    0 Yes 0 No
Vignesh1988i
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
If we have an array of Interger values, find out a sub array which has a maximum value of the array and start and end positions of the array..The sub array must be contiguious. Take the start add to be 4000. For Ex if we have an array arr[] = {-1,-2,-5,9,4,3,-6,8,7,6,5,-3} here the sub array of max would be {8,7,6,5} coz the sum of max contiguous array is 8+7+6+5 = 26.The start and end position is 4014(8) and 4020(5). Microsoft4
2. Counting in Lojban, an artificial language developed over the last fourty years, is easier than in most languages The numbers from zero to nine are: 0 no 1 pa 2 re 3 ci 4 vo 5 mk 6 xa 7 ze 8 bi 9 so Larger numbers are created by gluing the digit togather. For Examle 123 is pareci Write a program that reads in a lojban string(representing a no less than or equal to 1,000,000) and output it in numbers. Nagarro2
WAP TO ACCEPT STRING AND COUNT A COMES N TIMES B COMES N TIMES C COMES N TIMES D COMES N TIMES AND SO ON......... AT LAST UNTIL Z COMES N TIMES...............  3
without using arithmatic operator convert an intger variable x into x+1  1
compute the nth mumber in the fibonacci sequence? TCS7
int *a[5] refers to TCS8
#define d 10+10 main() { printf("%d",d*d); }  3
Give me basis knowledge of c , c++...  4
How would you sort a linked list?  1
Here is alphabets : abcdefgh 1) how to reverse. as hgfedcba 2) after reversal, how to group them in a pair hg fe dc ba.  2
what is data structure  4
Toggle nth bit in a given integer - num Qualcomm2
Go through the following code sinippet char a[20]; a="Hello Orcale Test"; will this compile? Oracle3
Concat two string with most overlapped substring has to remove  "abcd"+ "cdef" = "abcdef  5
Average of a couple 10 years ago was 25. The average remains same after having a child and twins after 3 years. What is the present age of the first child IBM9
write the function int countchtr(char string[],int ch);which returns the number of timesthe character ch appears in the string. for example the call countchtr("she lives in Newyork",'e') would return 3.  4
int a=2,b=3,c=4; printf("a=%d,b=%d\n",a,b,c); what is the o/p? Verifone6
Write a program to give following output..... ********* **** **** *** *** ** ** * * ** ** *** *** **** **** *********  2
What is the output of following program ? int main() { int x = 5; printf("%d %d %d\n", x, x << 2, x >> 2); } Qualcomm3
f1() { f(3);} f(int t) { switch(t); { case 2: c=3; case 3: c=4; case 4: c=5; case 5: c=6; default: c=0;} value of c? Geometric-Software5
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com