3 ms·
Hmm, interesting! I might be remembering wrong, but I remember within the last decade being told by a coworker that it was required for proper Windows support,
by saghm 4y ago
Hmm, interesting! I might be remembering wrong, but I remember within the last decade being told by a coworker that it was required for proper Windows support, but maybe that was just an old version of Visual Studio from XP or something that no longer needs to be supported.
- spc476 4y agoAnd C99 allows you to declare variables anywhere in the function (much like C++).
- saghm 4y agoI remember that the reason my coworker had said that they couldn't use local variables declared anywhere in functions for their Windows code was due to not supporting C99, but maybe that was just due to some external constraint rather than a Windows-specific one (like some customer needing them to support pre-C99 code or something).
- xenomachina 4y agoEven C89 supports block-level variable declarations. I think many C programmers are unaware of this, though, and mistakenly think that declarations are function-level only.