riva wrote:
Why the static variable in a function should be initialized by a
constant? Why not any normal variable.
Static variables are initialised /once/, before the program
proper starts executing. There are no "normal" (I'm taking
you to mean "automatic") variables to be had.
If you want to set your static to a dynamic value, you
can use a common-or-garden assignment statement.
Since one of the points of a static variable is that it
retains its value between calls of its enclosing function,
having it re-initialised on each call would be ... unhelpful.
--
Dynamic Not Duo Hedgehog
"Who do you serve, and who do you trust?" /Crusade/