What is the point of a constant in C#

Posted by Adam on Stack Overflow See other posts from Stack Overflow or by Adam
Published on 2010-03-28T04:08:50Z Indexed on 2010/03/28 4:13 UTC
Read the original article Hit count: 244

Filed under:
|

Can anyone tell what is the point of a constant in C#?

For example, what is the advantage of doing

cosnt int months = 12;

as opposed to

int months = 12;

I get that constants can't be changed, but then why not just... not change it's value after you initialize it?

© Stack Overflow or respective owner

Related posts about c#

Related posts about constants