did not include header file

answerme's Avatar, Join Date: Dec 2007
Ambitious contributor
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's Avatar, Join Date: Nov 2007
Ambitious contributor
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's Avatar, Join Date: Dec 2007
Ambitious contributor
To be honest NO ,could elaborate more
Salem's Avatar, Join Date: Nov 2007
Ambitious contributor
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.