Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

Write a program crashed before reaching main? If happen, how? 
In C,Using startup functions global variables are initialized before execution of main function.When any errors come in global memories than It can crashed before reaching the main.

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);
}