Hi,

I am trying to write to a binary file and while I am setting the values I have to convert an int to a char using
rec.cStopReason = (char) m_nStopCode; where the defnitions are as follows.
char cStopReason; //25
int m_nStopCode;

For all the values in m_nstopcode it works fine but when I have the value as 128 in m_nstopcode I get cStopReason as -128.

Can anyone help me understand why it is doing that.

Thanks,
Pushpa.