🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.msdos.programmer
Article #1208

Re: typecasting preferences

#1208
From: Max Waterman
Date: Thu, 18 Apr 1996 09:10
35 lines
1471 bytes
Posting from comp.lang.c.....

HASDI RODZMANN HASHIM 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;
> 

Prefer this one.

> a = (int)b; /* cast to int */

Never done this .. looks like a function .. misleading. Does it work in C?

> a = int(b); /* allowable in C++ */
> 

except in Pascal, of course.

> ...as for Pascal...
> a := integer(b); { "a" in an integer and "b" is a real }
> 
> Thanx!

-- 
    ___                      mailto:dwater@hursley.ibm.com
  /  /  /  _       /     /  _  __ __   _   __   _
 /  /  / /_/ |/  /  /  / /_/  /  /_   /_/ / / / /_/ /| /
/  /  / /  / /|  /_/_/ /  /  /  /_  /  |  / / / /  / / |/
Technical Details
Message-ID: <31760717.3F54@wight.hursley.ibm.com>
Path: arc1-ca.pugleaf.net!hursley.ibm.com!news
References: <4l020g$i9j@srvr1.engin.umich.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!hursley.ibm.com!news
From: Max Waterman <dwater@wight.hursley.ibm.com>
Newsgroups: alt.msdos.programmer,comp.lang.c,comp.lang.pascal.misc
Subject: Re: typecasting preferences
Date: Thu, 18 Apr 1996 10:10:47 +0100
Organization: IBM UK Laboratories Ltd.
Message-ID: <31760717.3F54@wight.hursley.ibm.com>
References: <4l020g$i9j@srvr1.engin.umich.edu>
Reply-To: dwater@hursley.ibm.com
NNTP-Posting-Host: wight.hursley.ibm.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 2.01 (X11; I; AIX 2)