add enum
This commit is contained in:
parent
a80d95a714
commit
865caaf37d
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,3 +6,4 @@ import/import
|
||||
compclass/compclass
|
||||
copy/copy
|
||||
structcons/structcons
|
||||
enum/enum
|
||||
|
12
enum/Makefile
Normal file
12
enum/Makefile
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
TARGET := enum
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(TARGET).d
|
||||
|
||||
%: %.d
|
||||
gdc -o $@ $<
|
||||
|
||||
clean:
|
||||
-rm -f *.o *~ $(TARGET)
|
22
enum/enum.d
Normal file
22
enum/enum.d
Normal file
@ -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);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user