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                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Code Snippets  >>  Programming Code  >>  C Code
 
 


 

 
 C Code interview questions  C Code Interview Questions
 C++ Code interview questions  C++ Code Interview Questions
 VC++ Code interview questions  VC++ Code Interview Questions
 Java Code interview questions  Java Code Interview Questions
 Dot Net Code interview questions  Dot Net Code Interview Questions
 Visual Basic Code interview questions  Visual Basic Code Interview Questions
 Programming Code AllOther interview questions  Programming Code AllOther Interview Questions
Question
char *someFun()

		{

		char *temp = “string constant";

		return temp;

		}

		int main()

		{

		puts(someFun());

		}
 Question Submitted By :: Susie
I also faced this Question!!     Rank Answer Posted By  
 
  Re: char *someFun() { char *temp = “string constant"; return temp; } int main() { puts(someFun()); }
Answer
# 1
Answer : 

		string constant 

Explanation:

		The program suffers no problem and gives the output
correctly because the character constants are stored in
code/data area and not allocated in stack, so this doesn’t
lead to dangling pointers.
 
Is This Answer Correct ?    0 Yes 0 No
Susie
 

 
 
 
Other C Code Interview Questions
 
  Question Asked @ Answers
 
main() { char *p = “ayqm”; printf(“%c”,++*(p++)); } TCS2
Finding a number which was log of base 2 NetApp1
struct point { int x; int y; }; struct point origin,*pp; main() { pp=&origin; printf("origin is(%d%d)\n",(*pp).x,(*pp).y); printf("origin is (%d%d)\n",pp->x,pp->y); }  1
main() { int a[10]; printf("%d",*a+1-*a+3); }  1
how to delete an element in an array  1
main() { signed int bit=512, mBit; { mBit = ~bit; bit = bit & ~bit ; printf("%d %d", bit, mBit); } } a. 0, 0 b. 0, 513 c. 512, 0 d. 0, -513 HCL1
main() { int i=5,j=10; i=i&=j&&10; printf("%d %d",i,j); }  1
main() { char not; not=!2; printf("%d",not); }  1
write the function. if all the character in string B appear in string A, return true, otherwise return false. Google10
main() { int i=10; i=!i>14; Printf ("i=%d",i); }  1
what will be the position of the file marker? a: fseek(ptr,0,SEEK_SET); b: fseek(ptr,0,SEEK_CUR);  1
void main() { static int i=5; if(--i){ main(); printf("%d ",i); } }  1
Write out a function that prints out all the permutations of a string. For example, abc would give you abc, acb, bac, bca, cab, cba. You can assume that all the characters will be unique. Microsoft4
main() { int i, j, *p; i = 25; j = 100; p = &i; // Address of i is assigned to pointer p printf("%f", i/(*p) ); // i is divided by pointer p } a. Runtime error. b. 1.00000 c. Compile error d. 0.00000 HCL1
main() { int i=-1; -i; printf("i = %d, -i = %d \n",i,-i); }  1
Write a program that find and print how many odd numbers in a binary tree  1
write a program to count the number the same (letter/character foreg: 's') in a given sentence.  1
Program to Delete an element from a doubly linked list. Infosys4
What is the subtle error in the following code segment? void fun(int n, int arr[]) { int *p=0; int i=0; while(i++<n) p = &arr[i]; *p = 0; }  1
#define SQR(x) x * x main() { printf("%d", 225/SQR(15)); } a. 1 b. 225 c. 15 d. none of the above HCL1
 
For more C Code 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