Code:
main()
{
const int Men = 10;
int *Women = &Men;
*Women = 20;
printf("There are %d men\n", Men);
}
|
Ambitious contributor
|
|
| 19Dec2007,10:26 | #1 |
|
Code:
main()
{
const int Men = 10;
int *Women = &Men;
*Women = 20;
printf("There are %d men\n", Men);
}
|
|
Ambitious contributor
|
|
| 19Dec2007,12:51 | #2 |
|
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? |
|
Ambitious contributor
|
|
| 19Dec2007,15:29 | #3 |
|
To be honest NO ,could elaborate more
|
|
Ambitious contributor
|
|
| 19Dec2007,19:50 | #4 |
|
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. |