Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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

Answers were Sorted based on User's Feedback



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

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

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

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

Post New Answer

More C Interview Questions

How can you increase the size of a statically allocated array?

0 Answers   TISL,


Why do we use c for the speed of light?

0 Answers  


In C program, at end of the program we will give as "return 0" and "return 1", what they indicate? Is it mandatory to specify them?

5 Answers  


What is meant by keywords in c?

0 Answers  


Which control loop is recommended if you have to execute set of statements for fixed number of times?

0 Answers  






any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above

0 Answers  


What is the difference between array and linked list in c?

0 Answers  


How many types of linked lists what are they? How many types of data structures?

18 Answers   BSNL, Pivotal Software,


plssssss help !!....using array.. turbo c.. create a program that will accept number of words to be consored. .a word must not exceed 10 characters long .the text to be entered will be no longer than 200 characters .there will be no 10 words example: enter number of words to be censor: 5 enter words to censor: windows office microsoft bill gates enter text to censor: bill gates founded microsoft and makes office and windows sample output: <consored> <censored> founded <censored> and makes <censored> and <censored>

1 Answers  


When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?

0 Answers  


in b=6.6/a+(2*a+(3*c)/a*d)/(2/n); which operation will be performed first a) 6.6/a b) 2*a c) 3*c d) 2/n

0 Answers  


Give the logic for this #include<stdio.h> #include<conio.h> void main() { clrscr(); int a=10,b; b=++a + ++a; printf("%d", b); getch(); } Output: 24......How?

2 Answers   Accenture,






Categories