Can you think of a way when a program crashed before
reaching main? If yes how?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is c programing language?

598


int i=10; printf("%d %d %d", i, i=20, i);

994


Calculate 1*2*3*____*n using recursive function??

1503


Explain how are portions of a program disabled in demo versions?

634


What is unary operator?

644






Write a C program linear.c that creates a sequence of processes with a given length. By sequence it is meant that each created process has exactly one child. Let's look at some example outputs for the program. Here the entire process sequence consists of process 18181: Sara@dell:~/OSSS$ ./linear 1 Creating process sequence of length 1. 18181 begins the sequence. An example for a sequence of length three: Sara@dell:~/OSSS$ ./linear 3 Creating process sequence of length 3. 18233 begins the sequence. 18234 is child of 18233 18235 is child of 18234 ........ this is coad .... BUt i could not compleate it .....:( #include #include #include #include int main(int argc, char *argv[]) { int N; pid_t pid; int cont; if (argc != 2) { printf("Wrong number of command-line parameters!\n"); return 1; } N = atoi(argv[1]); printf("Creating process sequence of length %d.\n",N); printf("%d begins the sequence.\n",getpid()); /* What I have to do next ?????? */ }

1608


What is a nested formula?

586


Explain can you assign a different address to an array tag?

628


What is the easiest sorting method to use?

625


what do you mean by inline function in C?

603


What is the use of a static variable in c?

578


How can I read and write comma-delimited text?

604


i have a written test for microland please give me test pattern

2163


Can one function call another?

612


What is enumerated data type in c?

607