Languages & Sizes | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Languages & Sizes

Do the programming languages have their "own" sizes which is different from language to language like, for example, 1 letter 2 bytes etc or are they all the same? (1 letter, symbol etc 8 bits = 1 byte) I think i got confused...

19th Sep 2017, 6:01 PM
Lampros
Lampros - avatar
2 Answers
+ 4
Well, you're not the only one with confusion, many including me do wonder about that. But so far I have learned to understand that: A character/letter, 1 byte, with Unicode its 2 bytes, with UTF-8 it's up to 3 bytes. An integer can be classified by its bit, there's 8, 16, 32 & 64 bit integer, divide the bits by 8, you get how many bytes it takes. A single precision floating point is 4 bytes, and double precision floating point 8 bytes. An IPv4 address is also 4 bytes, each byte represents a number, as unsigned byte. A date-time is 8 bytes, at least in a database field. One thing to note probably is the difference of machine and O/S, because I read that anything that is pointer internally, differs, a pointer in a 32 bit platform is 4 bytes, and in 64 bit it is 8 bytes. If you ever used VB6 you'll add up the confusion, in VB6 an integer is 16 bit (2 bytes), and long is 32 bits (4 bytes), although, VB.Net it is different, entirely. I hope I didn't bother you with my nonsense, was just in writing mood I guess. Hth, cmiiw
19th Sep 2017, 9:55 PM
Ipang
0
Well that's useful, maybe not the most clear answer but as you said many including me and you are confused about this topic. But at least, now, i know some practical information and that's good enough and i really appreciate it! And of course you didn't bother me! :) As i said above, it's really useful to know that. xd
19th Sep 2017, 10:27 PM
Lampros
Lampros - avatar