Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   did not include header file (http://www.go4expert.com/forums/include-header-file-t7921/)

answerme 19Dec2007 10:26

did not include header file
 
Code:

main()
{
  const int Men  = 10;
  int      *Women = &Men;

  *Women = 20;

  printf("There are %d men\n", Men);
 
}

I havent include #include header file but still prg is running how is it possible.

Salem 19Dec2007 12:51

Re: did not include header file
 
You got lucky. The compiler's guess as to what the function prototype should be was close enough to its actual declaration to produce something which worked.

Do you understand my sig yet?

answerme 19Dec2007 15:29

Re: did not include header file
 
To be honest NO ,could elaborate more

Salem 19Dec2007 19:50

Re: did not include header file
 
It's really saying that to be successful (long term) in your programs, you need to be good, not just lucky. C often lures you in with early success, despite making a catalogue of errors. But in larger programs, even the tiniest mistake will be punished harshly.

Like dancing on broken glass, sometimes you get away with it and at some other time, you're lying in ER suffering from severe blood loss.


All times are GMT +5.5. The time now is 10:57.