From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1cf653444208df72 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-21 19:07:44 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn4feed!worldnet.att.net!135.173.83.71!wnfilter1!worldnet-localpost!bgtnsc06-news.ops.worldnet.att.net.POSTED!not-for-mail From: "David Thompson" Newsgroups: comp.lang.ada References: <9pgr68$7pu1@news.cis.okstate.edu> <9phnic$9g5$1@nh.pace.co.uk> <5fkv7.134136$w7.19988807@news02.optonline.net> <9pmpk00a53@drn.newsguy.com> <9puvdc$225$1@nh.pace.co.uk> <9pv2f20jf4@drn.newsguy.com> <3BC3DA0A.267D4302@adaworks.com> <3BC45801.83F0B59@sparc01.ftw.rsc.raytheon.com> Subject: Re: ada vs. cpp X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Message-ID: Date: Mon, 22 Oct 2001 02:07:44 GMT NNTP-Posting-Host: 12.89.145.89 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc06-news.ops.worldnet.att.net 1003716464 12.89.145.89 (Mon, 22 Oct 2001 02:07:44 GMT) NNTP-Posting-Date: Mon, 22 Oct 2001 02:07:44 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:15005 Date: 2001-10-22T02:07:44+00:00 List-Id: Wes Groleau wrote : > Richard Riehle wrote: ... > > along with lots of other tricks to make Ada more like C. ... > > At least one thing is still missing: Automatic conversions between > Integer, Float, Character, Address, access, and Boolean. > There are no implicit conversions between pointer types and arithmetic types in (standard) C, nor in C++ for the same (C-equivalent) types. They require a cast, and are (at best) implementation-defined. (For a user-written numeric class in C++, of course you can and must write whatever conversion operators you want.) The only exception is the integer constant zero, or only in C constant zero cast to pointer-to-void, which is/are used to mean the null/nil pointer value. Technically this is not a conversion, just a kludgy special case left over from BCPL/B and "paleolithic" (pre-K&R1) C where pointers truly were just integers. The rest of your list -- arithmetic types (which in C and C++ includes char and wchar_t) and boolean -- stands. Plus enumerations in C, but only from not to them in C++. -- - David.Thompson 1 now at worldnet.att.net