Board index » cppbuilder » Conversion of short to an int.

Conversion of short to an int.


2005-05-13 05:02:49 AM
cppbuilder62
I was given predefined variables such as:
short x = ...
How could I convert this into a variable of simply type int that
wouldn't generate a compiler error. Apparently, simple casting doesn't work.
 
 

Re:Conversion of short to an int.

An assignment of any of the integral or floating point types to a type
short is a conversion defined by both the C and C++ languages and will
not generate an error.
Please show the actual code and variable declarations which generated
the compiler error.
. Ed
Quote
Saurabh Lahoti wrote in message
news:4283c479$ XXXX@XXXXX.COM ...

I was given predefined variables such as:

short x = ...

How could I convert this into a variable of simply type int that
wouldn't generate a compiler error. Apparently, simple casting
doesn't work.