Or, in other words, there must be no code path that allows the variable to be referenced while not yet initialized.
That leaves the problem of what value to initialize it to. I'm assuming you have a situation where, depending on other parameters, your value either gets assigned some specific value, or is left unassigned.
When the time comes to check the value, you have no way of distinguishing between the two states.
If you're using flotaing-point variable, they have a few special values (NaN, NegativeInfinity and PositiveInfinity) which might be useful. In case of integer types, you might define a certain value (MinValue, MaxValue, 0, -1, or whatever) as invalid and use that. |