Re: Java vs C++
On 02/07/2011 01:06 AM, Lawrence D'Oliveiro wrote:
In message<4d4f45fc$0$23760$14726298@news.sunsite.dk>, Arne Vajh??j wrote:
And the C spec leaves a lot of things to implementations.
Not too much that you can???t write portable code in it.
Writing portable code in C pretty much requires you to do hefty
compatibility layers. Many projects use typedefs to get proper-sized int
variables (you can't use stdint.h, as MSVC doesn't implement it, as of
MSVC 9.0). Anything more complex than basic I/O requires the use of
other, largely incompatible layers, for common things like
multithreading, asynchronous I/O, network I/O, etc. Let's not even get
into basic GUIs.
And even then, a careful reading of the C standard would reveal that it
gives very few absolute requirements of stuff, so that I could make
size_t be an 800-bit integer and still follow the standard, as well as
probably breaking everyone's so-called "portable C" code.
--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth