]> git.llucax.com Git - z.facultad/75.31/presentacion.git/commitdiff
Mejoras.
authorLeandro Lucarella <llucax@gmail.com>
Sat, 11 Jun 2005 04:43:03 +0000 (04:43 +0000)
committerLeandro Lucarella <llucax@gmail.com>
Sat, 11 Jun 2005 04:43:03 +0000 (04:43 +0000)
ejemplos/execpt.d [new file with mode: 0644]
ejemplos/gc.d [new file with mode: 0644]
ejemplos/modulo2.d

diff --git a/ejemplos/execpt.d b/ejemplos/execpt.d
new file mode 100644 (file)
index 0000000..19e91f3
--- /dev/null
@@ -0,0 +1,18 @@
+
+int main()
+{
+       try
+       {
+               //throw new Exception("execpcion");
+               assert(0);
+       }
+       catch (Exception e)
+       {
+               printf("%.*s\n", e.msg);
+       }
+       finally
+       {
+               printf("finally\n");
+       }
+       return 0;
+}
diff --git a/ejemplos/gc.d b/ejemplos/gc.d
new file mode 100644 (file)
index 0000000..c4cbf0c
--- /dev/null
@@ -0,0 +1,14 @@
+import std.c.stdlib;
+import std.gc;
+
+int main()
+{
+       int* p = new int[4];
+       p[3] = 1;
+       p=null;
+       fullCollect();
+       p = new int[4];
+       for (uint i = 0; i < 4; ++i) printf("p[%d] = %d\n", i, p[i]);
+       return 0;
+}
+
index 598d3b03f8fc61a8497575effd772772aa82ab00..564c26a7699bce50ecd98bfa9c7c8abade95e840 100644 (file)
@@ -1,3 +1,3 @@
 
-class C { int i; }
+class C { private int i; }