Hi all,
Quick question:
Is this a correct way to initialize all elements of an array to zero?
My instructor said that this works, but gcc does not like it, and returns an error. And in fact, everything I have read in books and on the 'net states that this shortcut is not available in C.
This fellow teaches C++ and Java as well, so maybe it's a mix-up?
Thanks!
Quick question:
Is this a correct way to initialize all elements of an array to zero?
Code:
double name[ size ] = {0.0}
My instructor said that this works, but gcc does not like it, and returns an error. And in fact, everything I have read in books and on the 'net states that this shortcut is not available in C.
This fellow teaches C++ and Java as well, so maybe it's a mix-up?
Thanks!