Why C allows multiple global declarations of the same variable but NOT multiple local declarations? [on hold]

Published: 4/10/2017
Why C allows multiple global declarations of the same variable but NOT multiple local declarations? [on hold]
Source: SOFTWAREENGINEERING.STACKEXCHANGE.COM

I noticed that if I declare a global variable multiple times the compiler does not even output a warning. However if I declare a local variable in a function multiple times, for example, the gcc compiler outputs an error and does not compile the file. (I ask in terms of gcc, but this is more a general language design question, not a question about gcc, because I think it is likely other compilers

Read more
Related news
Comment