Consider following program (See live demo here)
import std.stdio;
void main()
{
int i=int();
writefln("i is %d",i);
}
In language like C++ the statement int i=int();
is known as value initialization. For the type int
, value initialization basically ends up being zero initialization. If I am not wrong C++ standard guarantees that it gives me zero always. But is D language contain feature like value initialization as we have in C++? Is it necessarily give me a zero on all D compilers & on every environment where I compile & run above D program?