what for __ int8, __int16, __ int32, __ int64 and __ int128 are needed | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

what for __ int8, __int16, __ int32, __ int64 and __ int128 are needed

15th Apr 2018, 2:45 PM
King Sam
King Sam - avatar
9 Answers
+ 2
The numbers tell you, of how many bits the integer consists. So you use bigger integer types if you want to calculate bigger numbers, like factorials and smaller types to save memory (for example to program microcontrollers).
28th May 2018, 5:36 AM
Arc
Arc - avatar
+ 2
But when I used it , it gave error...so can you clearly show one example?
2nd Sep 2018, 6:52 AM
Gauri Shirkande
Gauri Shirkande - avatar
+ 2
Atharva Shirkande It could be a matter of your compiler... __int16 etc probably work with visual studio else you could try #include <cstdint> and then use int16_t instead
2nd Sep 2018, 7:22 AM
Arc
Arc - avatar
+ 2
ok... thanks 😄
2nd Sep 2018, 7:23 AM
Gauri Shirkande
Gauri Shirkande - avatar
+ 1
Quoted from MSDN: " If its name begins with two underscores (__), a data type is non-standard." https://msdn.microsoft.com/en-us/library/s3f49ktz.aspx
2nd Sep 2018, 7:24 AM
Ipang
+ 1
https://code.sololearn.com/cMNK2Ko1k3xc/?ref=app Atharva Shirkande
2nd Sep 2018, 7:41 AM
Arc
Arc - avatar
+ 1
can we do it for int8_t also?
2nd Sep 2018, 7:42 AM
Gauri Shirkande
Gauri Shirkande - avatar
+ 1
Atharva Shirkande yes, check out my code again
2nd Sep 2018, 12:38 PM
Arc
Arc - avatar
+ 1
Thank you so much😄
2nd Sep 2018, 3:02 PM
Gauri Shirkande
Gauri Shirkande - avatar