why global immutable string variable cannot be used after "case"?

Jonathan M Davis jmdavisProg at gmx.com
Fri Sep 23 10:36:07 PDT 2011


On Friday, September 23, 2011 01:38 Tobias Pankrath wrote:
> > If immutable cannot be used, what else can be used to replace #define
> > in C?
> > 
> > Thanks a lot.
> 
> immutables are runtime constants. For case you need a
> compile time constant, which you can define with enum.
> 
> enum string mycase = "value";

Or you could even reduce it to

enum mycase = "value";

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list