Re: Is cast operator unary or binary? How many operands?
- From: jacob navia <jacob@xxxxxxxxxx>
- Date: Wed, 30 Apr 2008 15:26:51 +0200
JoseMariaSola wrote:
How may operators and operands does (typename) expression has?
I'd say one operator, the cast operator, and two operands: typename
and expression.
But everywhere I read, cast is categorized as an unary operator. Why
is that? Is it just a syntax cotegory?
Thanks.
José María.
It has one argument: the expression, and a *result*
of type "typename"
When I write
(double)i;
I am conceptually calling
double TransformIntegerToDouble(int);
a function that takes ONE integer argument and outputs
a double number. Obviously there is no such a function
since the compiler inlines this cast when compiling, but
in some cases an actual function call will be generated.
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
.
- Follow-Ups:
- Re: Is cast operator unary or binary? How many operands?
- From: Richard Tobin
- Re: Is cast operator unary or binary? How many operands?
- References:
- Is cast operator unary or binary? How many operands?
- From: JoseMariaSola
- Is cast operator unary or binary? How many operands?
- Prev by Date: Re: Is cast operator unary or binary? How many operands?
- Next by Date: Re: Temporarily close stdout?
- Previous by thread: Re: Is cast operator unary or binary? How many operands?
- Next by thread: Re: Is cast operator unary or binary? How many operands?
- Index(es):
Relevant Pages
|