Peter Drese wrote:
Hello,
I have to write an exam and I am not sure about implicit typecasting.
There is no such thing. A "cast" or "type cast" is defined as an
explicit type conversion. In C, this is accomplished via the cast
operator (which looks like the name of a type inside parentheses).
"Implicit type cast" is an oxymoron, since a cast can never be implicit.
Can
somebody please tell me of what type the following c-statements are?
Statements do not have types. A statement is sort of a syntactic unit
that "stands alone", so to speak. Statements are evaluated for
side-effects, and don't "return" a result. Expressions, on the other
hand, have a resulting value (unless the type is 'void') of a particular
type, and may be evaluated both for side-effects and for this result.
And why
they are of this type? It is also possible that the statements are wrong.
C's type rules can be somewhat complex. You'd do better to ask specific
questions.
<Remainder snipped>
Regardless of whether this is homework or not, the fact that it seems
very much like homework is enough for most of us to avoid simply
supplying the answers, particularly because you gave no indication of
any attempt to determine those answers yourself. If we see some effort
on your part to solve the problem, we can tell you whether you are right
or not, gauge your level of knowledge about the subject, and see where
you might have misconceptions. All this helps us to help you, and shows
that you are interested in learning, not just in receiving answers. Most
of us consider helping people learn to be a good use of our time, but
don't consider supplying free answers to be.
-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.