From: Leandro Lucarella Date: Sat, 11 Jun 2005 04:43:03 +0000 (+0000) Subject: Mejoras. X-Git-Tag: svn_import~2 X-Git-Url: https://git.llucax.com/z.facultad/75.31/presentacion.git/commitdiff_plain/ce6a8d74993f4ee07f61a6e970c0a7c78e9f3607 Mejoras. --- diff --git a/ejemplos/execpt.d b/ejemplos/execpt.d new file mode 100644 index 0000000..19e91f3 --- /dev/null +++ b/ejemplos/execpt.d @@ -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 index 0000000..c4cbf0c --- /dev/null +++ b/ejemplos/gc.d @@ -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; +} + diff --git a/ejemplos/modulo2.d b/ejemplos/modulo2.d index 598d3b0..564c26a 100644 --- a/ejemplos/modulo2.d +++ b/ejemplos/modulo2.d @@ -1,3 +1,3 @@ -class C { int i; } +class C { private int i; }