Go Down

Topic: spi_transfer((char)(address>>8));  (Read 516 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).
"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


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

No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

Go Up