Article View: alt.msdos.programmer
Article #1199Re: typecasting preferences
From: Anon
Date: Tue, 16 Apr 1996 15:59
Date: Tue, 16 Apr 1996 15:59
26 lines
1245 bytes
1245 bytes
On 4/16/96 4:58AM, in message <4l020g$i9j@srvr1.engin.umich.edu>, HASDI
RODZMANN HASHIM <hasdi@news-server.engin.umich.edu> wrote:
> Hi guys! I think my earlier post got lost so here it is again.... This is
> for a student compiler project of mine....
>
> If you have a choice, do you want the parethesis pair over the caster
> (C-style) or over the castee (Pascal-style)? eg...
>
> int a;
> float b;
>
> a = (int)b; /* cast to int */
> a = int(b); /* allowable in C++ */
>
> ...as for Pascal...
> a := integer(b); { "a" in an integer and "b" is a real }
>
> Thanx!
>
I believe you would want the parens over the type not the variable. Your first
example a = (int)b looks like the way I would do it anyway. I am sure someone
will correct me on this one.
-John Machin
machin@gnn.com
Technical Details
Message-ID:
<N.041696.085930.117@machin.qdeck.com>Path:
arc1-ca.pugleaf.net!angel.qdeck.com!usenetReferences:
<4l020g$i9j@srvr1.engin.umich.edu>Show Full Headers
Complete Article Headers
Newsgroups: alt.msdos.programmer,comp.lang.c,comp.lang.pascal.misc Path: arc1-ca.pugleaf.net!angel.qdeck.com!usenet From: @test111 Subject: Re: typecasting preferences Organization: Quarterdeck Corp. Date: Tue, 16 Apr 1996 15:59:30 GMT Message-ID: <N.041696.085930.117@machin.qdeck.com> X-Newsreader: Quarterdeck Message Center [2.00] References: <4l020g$i9j@srvr1.engin.umich.edu> Sender: usenet@qdeck.com (Netnews Administrator)