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 Difference between Class and Struct?
what is c?
what are the advantages & disadvantages of unions?
how to print 212 as Twohundreds twelve plz provide me ans soon
Which is better oop or procedural?
Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.
1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321
What is static identifier?
What is a far pointer in c?
why return type of main is not necessary in linux
What is an arrays?
write a program for fibonaci series by using while loop in c?