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...
2 Antworten
+ 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
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