( Pontscho | 2012. 12. 14., p – 12:51 )

A c++ new operátor sem calloc-ot aztán konstruktort hív :)


aeryn:Downloads pontscho$ gdb main
GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Mon Aug 15 16:03:10 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
No registers.
Reading symbols for shared libraries ... done

(gdb) break 4
Breakpoint 1 at 0x100000f04: file main.cpp, line 4.
(gdb) r
Starting program: /Volumes/pontscho/Downloads/main 
Reading symbols for shared libraries ++. done

Breakpoint 1, main () at main.cpp:4
4		char *tmp = new char[128];
(gdb) n
5		return 0;
(gdb) dump memory main.dta tmp tmp+128
(gdb) q
The program is running.  Exit anyway? (y or n) y
aeryn:Downloads pontscho$ hexdump -n 128 -C main.dta
00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000080
aeryn:Downloads pontscho$ 

Biztos?

---
pontscho / fresh!mindworkz