add enum
This commit is contained in:
1 parent
a80d95a714
commit
865caaf37d
3 files changed
+35
No files matched your search
@@ -6,3 +6,4 @@ import/import
|
||||
compclass/compclass
|
||||
copy/copy
|
||||
structcons/structcons
|
||||
enum/enum
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
TARGET := enum
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(TARGET).d
|
||||
|
||||
%: %.d
|
||||
gdc -o $@ $<
|
||||
|
||||
clean:
|
||||
-rm -f *.o *~ $(TARGET)
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
|
||||
import std.stdio;
|
||||
|
||||
enum
|
||||
{
|
||||
N1,
|
||||
N2,
|
||||
N3
|
||||
}
|
||||
|
||||
enum E
|
||||
{
|
||||
E1,
|
||||
E2,
|
||||
E3
|
||||
}
|
||||
|
||||
void main(string[] args)
|
||||
{
|
||||
writefln("%s, %s, %s", N1, N2, N3);
|
||||
writefln("%s, %s, %s", E.E1, E.E2, E.E3);
|
||||
}
|
||||
Reference in new issue
Block a user