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 |
how to capitalise first letter of each word in a given string?
What is floating point constants?
how to compare two strings without using strcmp() function??
What is a c token and types of c tokens?
What does static variable mean in c?
Explain what are the advantages and disadvantages of a heap?
what is use of malloc and calloc?
write a program that will print %d in the output screen??
What are disadvantages of C language.
What is an array in c?
Function to find the given number is a power of 2 or not?
cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration