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 ANSWER IF ASKED " WHAT KIND OF A PERSON ARE YOU?" I NEED AN ANSWER THAT IMPRESS THE INTERVIEWER
given the piece of code int a[50]; int *pa; pa=a; to access the 6th element of the array which of the following is incorrect? a.*(a+5) b.a[5] c.pa[5] d.*(*pa + 5)
c program to compute AREA under integral
What does c mean in standard form?
What is a pointer variable in c language?
What’s a signal? Explain what do I use signals for?
What is pragma in c?
What is atoi and atof in c?
What is a ternary operator in c?
Write a program to check armstrong number in c?
What is union in c?
What is typedef example?