title: How does .Byte[] function on a specific byte?
body: <p>I am working on the following lines of code:</p>
  <pre><code>#define WDOG_STATUS             0x0440
  #define ESM_OP                    0x08  
  </code></pre>
  <p>and in a method of my defined class I have:</p>
  <pre><code>bool WatchDog = 0;
  bool Operational = 0;
  unsigned char i;
  ULONG TempLong;
  unsigned char Status;
  
  TempLong.Long = SPIReadRegisterIndirect (WDOG_STATUS, 1); // read watchdog status
  if ((TempLong.Byte[0] &amp; 0x01) == 0x01)
    WatchDog = 0;
  else
    WatchDog = 1;
  
  
  TempLong.Long = SPIReadRegisterIndirect (AL_STATUS, 1);
  Status = TempLong.Byte[0] &amp; 0x0F;
  if (Status == ESM_OP)
    Operational = 1;
  else
    Operational = 0;
  </code></pre>
  <p>What SPIReadRegisterInderect() does is, it takes an unsigned short as Address of the register to read and an unsigned char Len as number of bytes to read.</p>
  <p>What is baffling me is Byte[]. I am assuming that this is a method to separate some parts of byte from the value in Long ( which is read from SPIReadRegisterIndirect ). but why is that [0]? shouldn't it be 1? and how is that functioning? I mean if it is isolating only one byte, for example for the WatchDog case, is TempLong.Byte[0] equal to 04 or 40? (when I am printing the value before if statement, it is shown as 0, which is neither 04 nor 40 from WDOG_STATUS defined register.)</p>
  <p>Please consider that I am new to this subject. and I have done google search and other searchs but unfortunatly I could not found what I wanted. Could somebody please help me to understand how this syntax works or direct me to a documentation where I can read about it?</p>
  <p>Thank you in advance.</p>