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 the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.
What is an expression?
write c program without semicolon
11 Answers MindTech, TCS, Wipro,
Write a program to print the prime numbers from 1 to 100?
write a program to swap two numbers without using temporary variable?
without using control structures and control structures find the max and min of given 2 nos
What is wrong with this initialization?
What is meant by 'bit masking'?
Describe dynamic data structure in c programming language?
Write a program to exchange two variaables without temp
What is structure in c explain with example?
What is #line in c?