Why is size_t type uint on 64-bit Windows 7?

I am new to D programming. After reading the Basic types , I decided to check the size_t type on my 64 bit Windows 7. The code looks like this:

 import std.stdio; void main() { writeln("Type: ", size_t.stringof); writeln("Size: ", size_t.sizeof); } 

After execution exit:

 Type: uint Size: 4 

In my understanding, the type size_t should be laid out on a 64 bit OS.
Can anyone give any hint? Thank you very much in advance!

+5
source share
1 answer

The bitness of your program is different from that of the OS or compiler.

Use DMD to create the 64-bit executable file, specify the -m64 switch. By default, DMD will create programs with the same bit as the compiler, and the Windows package includes a 32-bit compiler. (If you want, you can also build a 64-bit compiler from the source code, but that will not affect the way it creates either 32-bit or 64-bit programs.)

+9
source

Source: https://habr.com/ru/post/1210347/


All Articles