Can you think of a way when a program crashed before
reaching main? If yes how?
Answers were Sorted based on User's Feedback
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 |
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 |
What is sizeof in c?
what is the significance of static storage class specifier?
What is f'n in math?
How does #define work?
implement OR gate without using any bitwise operator.
what is reason of your company position's in india no. 1.
Write a program for print infinite numbers
What is %s and %d in c?
Is there a way to jump out of a function or functions?
Explain pointers in c programming?
What is meant by errors and debugging?
What is indirect recursion? give an example?