Go Down

Topic: spi_transfer((char)(address>>8));  (Read 395 times) previous topic - next topic

Jstockma

Question: what does the (CHAR) syntax do in the following line of code?

  spi_transfer((char)(address>>8));   //send MSByte address first

Power_Broker

That is what's called a typecast. It casts the variable on its immediate right to the type specified within the parenthesis (char - in your case).
"The desire that guides me in all I do is the desire to harness the forces of nature to the service of mankind."
   - Nikola Tesla

larryd

I thought you might be asking what the 8) is doing in that line of code.


.
No technical PMs.
The last thing you did is where you should start looking.

Go Up