Possible Duplicate:
What is the difference between const and readonly?
So from what I read, in C#, const and static readonly will both make a value unalterable during the execution of a program.
However, const should be used with quantities which are unlikely to ever change (e.g. pi, radius of earth, litters per gallon etc.).
On the other hand, static readonly should be used with values that currently are constant but might/will change in the future (e.g. software version, a multiplier in an algorithm etc.).
Have I got it right?
I don’t know about your second item (I would probably use a constant for a software version or an algorithm… constant) but there is one key difference between the two:
constcan only hold basic types such asstring,bool, or numeric types.static readonlycan hold any object. So, for example, I often usestatic readonlyto store resources likeBitmapobjects. Those cannot beconst.