Can you think of a way when a program crashed before
reaching main? If yes how?

Answers were Sorted based on User's Feedback



Can you think of a way when a program crashed before reaching main? If yes how?..

Answer / sunil

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 ?    5 Yes 0 No

Can you think of a way when a program crashed before reaching main? If yes how?..

Answer / pyari

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 1 No

Post New Answer

More C Interview Questions

different between overloading and overriding

3 Answers  


program to find the magic square

1 Answers   Infosys,


. Write a program to get a string and to convert the 1st letter of it to uppercase

2 Answers   HTC,


If I have a char * variable pointing to the name of a function ..

0 Answers  


How will you print TATA alone from TATA POWER using string copy and concate commands in C?

0 Answers   Amdocs, Apps Associates,






char p="data"; printf(p);

2 Answers  


Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.

0 Answers  


to find the closest pair

0 Answers   Infosys,


Explain null pointer.

0 Answers  


Explain data types & how many data types supported by c?

0 Answers  


a number is perfect if it is equal to the sum of its proper divisor.. 6 is perfect number coz its proper divisors are 1,2 and three.. and 1+2+3=6... a number is deficient if the sum of its proper divisor is less than the number.. sample: 8 is deficient, coz its proper divisors are 1,2 and 4, and 1+2+4=7. abundant number, if the sum of its proper divisor is greater than the number.. sample..12 is abundant coz 1+2+3+4+6=16 which is geater than 12. now write a program that prompts the user for a number, then determines whether the number is perfect,deficient and abundant..

1 Answers  


What is formal argument?

0 Answers  


Categories