Associative Array, key and value as type of string or char[]

Namespace rswhite4 at googlemail.com
Sat Feb 2 07:06:02 PST 2013


It seems you are right. I get the same error. You should open a 
bug report for this.
But as long as it isn't fixed you can use an output via foreach.

import std.stdio;

void main() {
	string[string] ch_Description = [
		"kill" : "kills a process",
		"pause" : "pauses a process"
	];
	
	// writeln(ch_Description); // does not work, but it should
	foreach (string key, string value; ch_Description) {
		writeln(key, ':', value);
	}
}


More information about the Digitalmars-d-learn mailing list