Código C++:
Dejo el mensaje de error..Ver original
class C { int * elem; public: C(long n) { elem= new int [n]; } ~C() { delete [] elem; } }; int main() { C a(5); a.~C(); return 0; }
Código:
Gracias de antemano. *** glibc detected *** ./ejemplo: double free or corruption (fasttop): 0x080f4008 *** ======= Backtrace: ========= /lib/i386-linux-gnu/libc.so.6(+0x75b12)[0xb7515b12] /usr/lib/i386-linux-gnu/libstdc++.so.6(_ZdlPv+0x1f)[0xb76f351f] /usr/lib/i386-linux-gnu/libstdc++.so.6(_ZdaPv+0x1b)[0xb76f357b] ./ejemplo[0x80484f0] ./ejemplo[0x80484af] /lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0xb74b94d3] ./ejemplo[0x80483e1] ======= Memory map: ======== 08048000-08049000 r-xp 00000000 08:05 10888315 /home/alejandro/Escritorio/Programas C/Maths/ejemplo 08049000-0804a000 r--p 00000000 08:05 10888315 /home/alejandro/Escritorio/Programas C/Maths/ejemplo 0804a000-0804b000 rw-p 00001000 08:05 10888315 /home/alejandro/Escritorio/Programas C/Maths/ejemplo 080f4000-08115000 rw-p 00000000 00:00 0 [heap] b7453000-b7455000 rw-p 00000000 00:00 0 b7455000-b7471000 r-xp 00000000 08:05 6423436 /lib/i386-linux-gnu/libgcc_s.so.1 b7471000-b7472000 r--p 0001b000 08:05 6423436 /lib/i386-linux-gnu/libgcc_s.so.1 b7472000-b7473000 rw-p 0001c000 08:05 6423436 /lib/i386-linux-gnu/libgcc_s.so.1 b7473000-b749d000 r-xp 00000000 08:05 6432598 /lib/i386-linux-gnu/libm-2.15.so b749d000-b749e000 r--p 00029000 08:05 6432598 /lib/i386-linux-gnu/libm-2.15.so b749e000-b749f000 rw-p 0002a000 08:05 6432598 /lib/i386-linux-gnu/libm-2.15.so b749f000-b74a0000 rw-p 00000000 00:00 0 b74a0000-b7644000 r-xp 00000000 08:05 6432584 /lib/i386-linux-gnu/libc-2.15.so b7644000-b7646000 r--p 001a4000 08:05 6432584 /lib/i386-linux-gnu/libc-2.15.so b7646000-b7647000 rw-p 001a6000 08:05 6432584 /lib/i386-linux-gnu/libc-2.15.so b7647000-b764a000 rw-p 00000000 00:00 0 b764a000-b7722000 r-xp 00000000 08:05 1318061 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16 b7722000-b7723000 ---p 000d8000 08:05 1318061 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16 b7723000-b7727000 r--p 000d8000 08:05 1318061 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16 b7727000-b7728000 rw-p 000dc000 08:05 1318061 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16 b7728000-b772f000 rw-p 00000000 00:00 0 b774d000-b7750000 rw-p 00000000 00:00 0 b7750000-b7751000 r-xp 00000000 00:00 0 [vdso] b7751000-b7771000 r-xp 00000000 08:05 6432601 /lib/i386-linux-gnu/ld-2.15.so b7771000-b7772000 r--p 0001f000 08:05 6432601 /lib/i386-linux-gnu/ld-2.15.so b7772000-b7773000 rw-p 00020000 08:05 6432601 /lib/i386-linux-gnu/ld-2.15.so bfcdb000-bfcfc000 rw-p 00000000 00:00 0 [stack]