Hi all,
I would like to know if there is anything wrong with this initialization
and declaration:
void SomeFunction(void) {
int counter = 0; /* <------- Is this legal? */
...
Is this illegal in C. On page 40 of K&R Edition2 it says:
"An explicitly initialized automatic variable is initialized
each time the function or block it is in is entered; the initializer
may be any expression."
It seems to me that I can write:
int counter = 0;
But I have been told that it is technically not allowed!
Thank you in Advance,
Sincerely,
Nader
--
---------------------------------------------------------------------
| |
| Nader T. Behzad |
| e-mail: nbeh...@ee.ualberta.ca |
| WWW: http://www.ee.ualberta.ca/~nbehzad |
| |
|===================================================================|
| |
| "Whatever you do will be insignificant, but it is very |
| important that you do it." --Mahatma Gandhi |
| |
---------------------------------------------------------------------