Go Down

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


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

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


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).
   - Nikola Tesla


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

No technical PMs.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

Go Up