The specific number of bytes of int long short is implement defined. The specific number depends on the compiler implementation. There is no absolute number. Only the same compiler can guarantee the same size
If you want a sizeof pointer, make sure you use sizeof(void*)
MinGW is LLP64, long is 32-bit.
Note that when you malloc, if the parameters are represented by signed int, then when you apply for 2Gb memory, you may put a number exceeding 2^31 into signed int, and the data overflow will cause malloc to fail. You should use size_t
If you are curious about how many bits your program is, you can open the task manager. There will be a *32 mark behind the 32-bit process
The specific number of bytes of int long short is implement defined. The specific number depends on the compiler implementation. There is no absolute number. Only the same compiler can guarantee the same size
If you want a sizeof pointer, make sure you use
sizeof(void*)
MinGW is LLP64, long is 32-bit.
Note that when you malloc, if the parameters are represented by signed int, then when you apply for 2Gb memory, you may put a number exceeding 2^31 into signed int, and the data overflow will cause malloc to fail. You should use size_t
If you are curious about how many bits your program is, you can open the task manager. There will be a *32 mark behind the 32-bit process