static
determines visibility outside of a function or a variables lifespan inside. So it has nothing to do with const
per se.
const
means that you're not changing the value after it has been initialised.
static
inside a function means the variable will exist before and after the function has executed.
static
outside of a function means that the scope of the symbol marked static
is limited to that .c file and cannot be seen outside of it.
Technically (if you want to look this up), static
is a storage specifier and const
is a type qualifier.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…