, . , . , , .
, :
int *p = new int;
, , , undefined . IE 0x00, 0xFFFFFFFF, (aka RIP register Intel) . .
int *p = new int;
std::cout << *p;
, Valgrind ASan , .
, :
int *p = new int;
*p = 0;
Background information: This particular way of writing a specification is very useful for performance because it is prohibitively expensive to implement an alternative.
Please note that according to standard links, initialization is sometimes cheap, so you can do the following:
int global1;
int global2 = 1;
void f()
{
std::cout << global1;
}
These things are included in executable sections (.bss and .data) and are initialized by the bootloader.
source
share