user16336: I wanted to my GSM to recieve SMSs. I have written a sketch for it. But while verifying the sketch an error pops out in this part:
if (sms.available()) {
      sms.remoteNumber(senderNnumber, 20);
      if (senderNumber == "09432167015") {
        c = sms.read();
      if (c == "yes") {
          alarm_police();
          }
        }
      }   
The error message:

Arduino: 1.6.5 (Windows 8.1), Board: "Arduino/Genuino Uno"
GuardDog_v2.5.ino: In function 'void loop()':
  GuardDog_v2.5:201: error: 'senderNnumber' was not declared in this scope
  GuardDog_v2.5:204: error: ISO C++ forbids comparison between pointer and >integer [-fpermissive]
  'senderNnumber' was not declared in this scope
This report would have more information with
   "Show verbose output during compilation"
   enabled in File > Preferences.

I have checked the receiving sms example and have written the sketch according to the example.I need help regarding this error and how to fix it

user11763: You misspelled the variable senderNumber. Correct it. Also you aren't reading the SMS properly or comparing the phone numbers properly. Your code should be like this (using the examples):
#define MAX_MSG 50

char senderNumber[20];
char sms_buf[MAX_MSG];   // a buffer for your sms, max len = 50

if (sms.available()) {    // this part should be in loop()
  sms.remoteNumber(senderNumber, 20);
  if (strcmp(senderNumber, "09432167015") == 0) { // compare numbers
    while (sms.available() == 0);   // wait for a char
    char i = 0;
    while (i < MAX_MSG - 1){    // till max len is reached; 1 byte for null
      c = sms.read();
      if (c == '\0')  // assuming the modem terminates sms with null
        break;
      sms_buf[i++] = c;   // write char to the buffer
      while (sms.available() == 0);   //wait for a char
    }
    sms_buf[i] = 0;   // terminate the string, just in case
    if (strstr(sms_buf, "yes") != NULL)  // look for 'yes' in buffer
      alarm_police();
  }
}


16336: <p>I wanted to my GSM to recieve SMSs. I have written a sketch for it. But while verifying the sketch an error pops out in this part:</p>

<p><code>if (sms.available()) {
      sms.remoteNumber(senderNnumber, 20);
      if (senderNumber == "09432167015") {
        c = sms.read();
      if (c == "yes") {
          alarm_police();
          }
        }
      }   </code>
<br><br>The error message:</p>

<blockquote>
  <p>Arduino: 1.6.5 (Windows 8.1), Board: "Arduino/Genuino Uno"</p>
  
  <p>GuardDog_v2.5.ino: In function 'void loop()':
  GuardDog_v2.5:201: error: 'senderNnumber' was not declared in this scope
  GuardDog_v2.5:204: error: ISO C++ forbids comparison between pointer and >integer [-fpermissive]
  'senderNnumber' was not declared in this scope</p>
  
  <p>This report would have more information with
   "Show verbose output during compilation"
   enabled in File > Preferences.</p>
</blockquote>

<p><br><Br>I have checked the receiving sms example and have written the sketch according to the example.I need help regarding this error and how to fix it</p>
 11763: <p>You misspelled the variable <code>senderNumber</code>. Correct it. Also you aren't reading the SMS properly or comparing the phone numbers properly. Your code should be like this (using the examples):</p>

<pre><code>#define MAX_MSG 50

char senderNumber[20];
char sms_buf[MAX_MSG];   // a buffer for your sms, max len = 50

if (sms.available()) {    // this part should be in loop()
  sms.remoteNumber(senderNumber, 20);
  if (strcmp(senderNumber, "09432167015") == 0) { // compare numbers
    while (sms.available() == 0);   // wait for a char
    char i = 0;
    while (i &lt; MAX_MSG - 1){    // till max len is reached; 1 byte for null
      c = sms.read();
      if (c == '\0')  // assuming the modem terminates sms with null
        break;
      sms_buf[i++] = c;   // write char to the buffer
      while (sms.available() == 0);   //wait for a char
    }
    sms_buf[i] = 0;   // terminate the string, just in case
    if (strstr(sms_buf, "yes") != NULL)  // look for 'yes' in buffer
      alarm_police();
  }
}
</code></pre>
