Sathyaish wrote:
Can we have a pre-processor directive such as
#define LEN 132
No. The "pre-processor" is basically used for conditional compilation,
diagnostics and regions.
Instead, you should define a constant in a class, eg:
public class Something
{
public const int MaxLength = 132;
}
Note that there's a difference between a "const" and a static readonly
field - the value of a const is fetched at compile-time, so if you
change the value you'll need to recompile all the assemblies which used
it. A static readonly field would be fetched at runtime, so changes
will be picked up automatically.
Jon