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  >>  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
Can you think of a way when a program crashed before
reaching main? If yes how?
 Question Submitted By :: Larry
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Can you think of a way when a program crashed before reaching main? If yes how?
Answer
# 1
int foo ()
 {
        // It comes here before main is invoked
        //Hence a crash happening in this function  
obviously ,will happen before main is called
 	 

         //  s simple crash :)
         swprintf(NULL,L"%s",L"crash");
	 return 1;
    
 }

int i = foo ();
 
int _tmain(int argc, _TCHAR* argv[])
 {
    return (  0 );
 }
 
Is This Answer Correct ?    2 Yes 0 No
Pyari
 
  Re: Can you think of a way when a program crashed before reaching main? If yes how?
Answer
# 2
The global variables get initialized by the c startup
functions before the main function is being called.
Hence any error in global variables will cause a crash
before reaching the main.
 
Is This Answer Correct ?    4 Yes 0 No
Sunil
 
 
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
void main(int argc,char *argv[],char *env[]) { int i; for(i=1;i<argc;i++) printf("%s",env[i]); }  2
How can I allocate arrays or structures bigger than 64K?  4
What compilation do? Geometric-Software7
#define f(x) main() { printf("\n%d",f(2+2)); }  3
helllo sir , what is the main use of the pointer ,array ,and the structure with the example of a programe  2
What is C language Terminator? TCS12
can we access one file to one directory?  1
Is reference used in C?  1
What is the Difference between Class and Struct? Motorola9
An interactive c program to read basic salary of 15 persons. each person gets 25% of basic as HRA, 15%of basic as conveyance allowances, 10%of basic as entertainment allowances.The total salary is calculated by adding basic+HRA+CA+EA.Calculate how many out of 15 get salary above 10,000.Rs also print the salary of each employee  2
Reverse the part of the number which is present from position i to j. Print the new number.[without using the array] eg: num=789876 i=2 j=5 778986  2
what is real time system?what is the differance between hard and soft real time systems  2
long int size a) 4 bytes b) 2 bytes c) compiler dependent d) 8 bytes HCL11
what is the output of the following program? main() { int c[]={2,8,3,4,4,6,7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf("%d",*c); ++q; } for(j=0;j<5;j++) { printf("%d",*p); ++p; } }  4
main() { printf(5+"Vidyarthi Computers"); }  6
program to find which character is occured more times in a string and how many times it has occured? for example in the sentence "i love india" the output should be i & 3.  3
What will be the result of the following program? main() { char p[]="String"; int x=0; if(p=="String") { printf("Pass 1"); if(p[sizeof(p)-2]=='g') printf("Pass 2"); else printf("Fail 2"); } else { printf("Fail 1"); if(p[sizeof(p)-2]=='g') printf("Pass 2"); else printf("Fail 2"); } } a) Pass 1, Pass 2 b) Fail 1, Fail 2 c) Pass 1, Fail 2 d) Fail 1, Pass 2 e) syntax error during compilation IBM10
without using arithmatic operator solve which number is greater??????????  1
#ifdef TRUE int I=0; #endif main() { int j=0; printf("%d %d\n",i,j); } ADITI2
Write a C program that reads a series of strings and prints only those ending in "ed"  2
 
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