invalid types 'uint8_t {aka unsigned char}[int]' for array subscript
<p>I copied a script from a YouTube video because there was no download link to the script, but now i'm always getting the same error message and I don't know what to do. Could you help me?</p>

<p>This is my code: </p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>#include &lt;VirtualWire.h&gt;

int ledPassive = 5;
int ledActive = 7;
int motor = 8;

void setup() {
  // put your setup code here, to run once:
pinMode(ledPassive,OUTPUT);
pinMode(ledActive,OUTPUT);
pinMode(motor,OUTPUT);
vw_set_ptt_inverted(true);
vw_set_rx_pin(12);
vw_setup(4000);
vw_rx_start();

}

void loop()
{
  
digitalWrite(ledPassive,HIGH);
digitalWrite(motor,LOW);
digitalWrite(ledActive,LOW);
uint8_t buf(VW_MAX_MESSAGE_LEN);
uint8_t buflen = VW_MAX_MESSAGE_LEN;

if (vw_get_message(buf, &amp;buflen)) {
  if (buf[0]=='X'){
    digitalWrite(ledPassive,LOW);
    for (int i=0;i&lt;10;i++){
      digitalWrite(motor,LOW);
      digitalWrite(ledActive,HIGH);
      delay(200);
      digitalWrite(motor,HIGH);
      digitalWrite(ledActive,LOW);
      delay(200);
    }
}
  else if (buf[0]!='x'){
    digitalWrite(ledPassive,HIGH);
  }
}
}</code></pre>
</div>
</div>
</p>

<p>And this is the error message:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>Arduino: 1.6.10 (Windows 10), Board:"Arduino Nano, ATmega328"

In function 'void loop()':

sketch_aug18e_self_made:29: error: invalid types 'uint8_t {aka unsigned char}[int]' for array subscript

   if (buf[0]=='X'){

            ^

sketch_aug18e_self_made:40: error: invalid types 'uint8_t {aka unsigned char}[int]' for array subscript

   else if (buf[0]!='x'){

                 ^

exit status 1
invalid types 'uint8_t {aka unsigned char}[int]' for array subscript

This report would have more information with
"Show verbose output during compilation"
option enabled in File -&gt; Preferences.</code></pre>
</div>
</div>
</p>

<p>Sorry for the bad language i'm dutch and not so very good at English</p>