zubzub
04/05/2017, 8:56 AMolonho
04/05/2017, 9:06 AMzubzub
04/05/2017, 9:11 AMolonho
04/05/2017, 9:20 AMzubzub
04/05/2017, 9:22 AMolonho
04/05/2017, 10:02 AMzubzub
04/05/2017, 10:48 AMolonho
04/05/2017, 11:25 AMzubzub
04/05/2017, 11:40 AMolonho
04/05/2017, 2:21 PMsizeof(size_t)
is known at compile timesvyatoslav.scherbina
04/05/2017, 2:29 PMie, if I call extend on a 32bit int, and my target size_t is 32bit at runtime, will it make it 64bit or keep it at 32bit?These functions extend or reduce the size exactly to the target type. So if you call extend on a 32bit int, and your target size_t is 32bit, then it will keep it at 32bit.
say on one architecture size_t is 16-bit, on another architecture it's 64-bit
I have a 32-bit int that I need to convert to size_itIn this case you can convert your 32-bit
Int
to Short
and then sign-extend it to size_t
. It seems to be the most safe approach.zubzub
04/06/2017, 12:59 PM