Talk:Compound data type: Difference between revisions

m
(Problems with extended task)
 
(6 intermediate revisions by 2 users not shown)
Line 7:
:* Also, there's no guarantee that short is 16 bit and long is 32 bit. Indeed, IIRC on some 64-bit architectures long is 64 bits. I think that's because until the 1999 standard (C99), C did not officially support the long long int type.
:* While int indeed is intended to be the "natural" size, which could reasonably be interpreted as "register size", in practice this is not universally true either. On 64 bit platforms, int is quite often still 32 bit, in order to maintain compatibility with (technically broken) code which assumes 32-bit int.
:* There's even less a guarantee on the floating point types. Well, if you are on an IEEE floating point compatible platform, then the sizes of float and double are virtually guaranteed by the IEEE floating point standard (which is separate from the C standard). However, the size of long double isn't guaranteed, and indeed, with a ''very'' popular OS/compiler combination (Visual C++ on 32-bit Windows), [http://support.microsoft.com/default.aspx?scid=kb;en-us;129209 Visual C++ on 32-bit Windows]), long double is exactly the same size as double]. Of course not every platform has IEEE compliant floating point anyway, thus your floats, doubles and long doubles might be any size.
:* The char[80] also is not an ANSI string. It's a character array, using whatever character encoding is used on the machine. On Windows this is typically "ANSI" (more exactly, CP-1252, which is a slight variation of ISO-8859-1), on Linux, it's typically ISO-8859-1, and on EBCDIC systems (yes, they still exist), it's typically EBCDIC (who would have guessed).
: At least the comment on the wchar_t array is correct: It's indeed not sure that it is UTF16; on Linux e.g. it's typically UCS4 aka UTF32. Of course the standard doesn't guarantee that it's even Unicode; I don't know if there's any implementation which doesn't use Unicode here, though.
: BTW, if you want guaranteed integer sizes, then you can use C99's int8_t etc.; AFAIK there's no equivalent for floating point. --[[User:Ce|Ce]] 09:06, 26 February 2007 (EST)
::I reverted the task to its most recent version with the previous description. It pains me to see all that work thrown away, but the task became too specific and, as you folks pointed out, inaccurate. I'm going to block the IP of the offending user until I can get in touch with him. --[[User:Short Circuit|Short Circuit]] 10:46, 26 February 2007 (EST)
 
== New page name ==
 
Unfortunately the new name is as ambiguous as the old. My first thought when I read "complex data type" is "a type which models complex numbers." --[[User:Ce|Ce]] 19:26, 26 February 2007 (EST)
:I realized later it should be "Compound Data Type" ... This page is going to leave a trail through the namespace a mile wide... --[[User:Short Circuit|Short Circuit]] 19:31, 26 February 2007 (EST)
Anonymous user