import std.stdio;
struct XmlElement{
string tag;
string[string] attributes;
XmlElement[] elements;
void show(){
write("<",tag," ");
for( int i = 0 ; i < attributes.length ; i++ ) {
write(attributes.keys[i],"=","\"",attributes.values[i],"\"");
}
for( int i = 0 ; i < elements.length ; i++ ) {
write(">",elements[i].show(),"<\\",tag,">"); //Hata burada
}
writeln();
}
}
void main(){
XmlElement eleman;
XmlElement diğer;
eleman.tag="a";
eleman.attributes=["title":"merhaba"];
diğer.tag="b";
eleman.elements=[diğer];
eleman.show();
}
Bu kod hata veriyor.Acaba fonksiyon prototipi mi istiyor?
--
[ Bu gönderi, http://ddili.org/forum'dan dönüştürülmüştür. ]