Why does this snippet print the enum identifiers instead of their values?

Gary Willoughby dev at kalekold.net
Tue May 28 04:49:23 PDT 2013


Why does the following snippet print:

"Started name revision" instead of "Started my-app 1.0a"?

import std.stdio;

enum application : string
{
	name     = "my-app",
	revision = "1.0a",
}

void main(string[] arguments)
{
	writefln("Started %s %s", application.name, 
application.revision);
}


More information about the Digitalmars-d-learn mailing list