user32623: int temp=A0;
#include<stdlib.h>
#include <SoftwareSerial.h>

#define SSID "rab"
#define PASSWORD "rakesh1234"
#define IP "184.106.153.149" // thingspeak.com
String GET = "GET /update?key=B8B8E4FC1K541QZQ&field1=";
SoftwareSerial monitor(0, 1); // RX, TX
SoftwareSerial mySerial(5, 6); // RX, TX
int p1=0,p2=0,p3=0;
int i=0;
int j=0;

void setup() {
  pinMode(A0,INPUT);
  Serial.begin(115200);
  monitor.begin(115200);
  mySerial.begin(9600);
  sendDebug("AT");
  delay(2000);
  if(Serial.find("OK")) {
    monitor.println("RECEIVED: OK");
    Serial.println("RECEIVED: OK");
  }
  connectWiFi();
}

unsigned char buf[50];

void loop() {
   while(!mySerial.available());
   if(mySerial.read() == '#') {
     for(int i=0;i<12;i++) {
       while(!mySerial.available());
       buf[i] = mySerial.read();
     }
     buf[3] =0;
     buf[7]=0;
     buf[11]=0;
     p1 = atoi((const char *)&buf[0]);
     p2 = atoi((const char *)&buf[4]);
     p3 = atoi((const char *)&buf[8]);
     delay(1000);
   }

   long int SensorValue=analogRead(temp);
   SensorValue=SensorValue*5000;
   SensorValue=SensorValue/1024;
   SensorValue=SensorValue/10;
   SensorValue=SensorValue*9;
   SensorValue=SensorValue/5;
   SensorValue=SensorValue+32;
   String tempF=String(p1);
   String tempFF=String(p2);
   String tempFFF=String(p3);
   String tempFFFF=String(SensorValue);

   for(int j=0;j>-1;j++) {
     **j= Serial.read(int p1, int p2, int p3);**
   }
   while(Serial.available()==j)
     updateTemp(tempF,tempFF,tempFFF,tempFFFF);
   while(1) {}
 }

 void updateTemp(String tempF1 ,String tempF2, String tempF3,  String tempF4) {
   String cmd = "AT+CIPSTART=\"TCP\",\"";
   cmd += "api.thingspeak.com";
   cmd += "\",80";
   sendDebug(cmd);
   delay(1000);
   if(Serial.find("Error")) {
     monitor.print("RECEIVED: Error");
     Serial.print("RECEIVED: ERROR");
     return;
   }
   cmd = GET;
   cmd += tempF1;
   cmd += "&field2=";
   cmd += tempF2;
   cmd +="&field3=";
   cmd +=tempF3;
   cmd +="&field4=";
   cmd +=tempF4;
   cmd += "\r\n";
   Serial.print("AT+CIPSEND=");
   Serial.println(cmd.length());
   if(Serial.find(">")) {
     monitor.print(">");
     monitor.print(cmd);
     Serial.print(cmd);
   } else {
     sendDebug("AT+CIPCLOSE");
   }
   if(Serial.find("OK")) {
     monitor.println("RECEIVED: OK");
   } else {
     monitor.println("RECEIVED: Error");
   }
 }

 void sendDebug(String cmd) {
   monitor.print("SEND: ");
   monitor.println(cmd);
   Serial.println(cmd);
 }

 boolean connectWiFi() {
   Serial.println("AT+CWMODE=1");
   delay(2000);
   String cmd="AT+CWJAP=\"";
   cmd+=SSID;
   cmd+="\",\"";
   cmd+=PASSWORD;
   cmd+="\"";
   sendDebug(cmd);
   delay(1000);
   if(Serial.find("OK")) {
     monitor.println("RECEIVED: OK");
     return true;
   } else {
     monitor.println("RECEIVED: Error");
     return false;
   }
 }

This is my code. I am getting an error as "exit status 1 
expected primary-expression before 'int'"
Please help me.
Thank you.

user6628: You are doing Serial.read() wrong with:
Serial.read(int p1, int p2, int p3);

Serial.read() takes no parameters per https://www.arduino.cc/en/Serial/read
Maybe you want to try parseInt() instead?

user-1: Your problem is that your are using asterisks ("*")
   for(int j=0;j>-1;j++) {
     **j= Serial.read(int p1, int p2, int p3);**
   }

The asterisk in C/C++ is the pointer operator. You use to get the value pointed by a pointer.
The expression **j means that j is a pointer to a pointer that points something. That's is meaningless here.
Then, the last ** is readed as another pointer to a pointer, and the compiler is expecting a variable or expression that give the value for the pointer, but found "}", which is an error.
You probably tried to comment out that line of code after the compiler barks at the Serial.read(), which, as Dave X pointed out, is illegal, because Serial.read() takes no arguments.
And, the syntax function(int x) is only use for declaring a function, not for calling one.

32623: <pre><code>int temp=A0;
#include&lt;stdlib.h&gt;
#include &lt;SoftwareSerial.h&gt;

#define SSID "rab"
#define PASSWORD "rakesh1234"
#define IP "184.106.153.149" // thingspeak.com
String GET = "GET /update?key=B8B8E4FC1K541QZQ&amp;field1=";
SoftwareSerial monitor(0, 1); // RX, TX
SoftwareSerial mySerial(5, 6); // RX, TX
int p1=0,p2=0,p3=0;
int i=0;
int j=0;

void setup() {
  pinMode(A0,INPUT);
  Serial.begin(115200);
  monitor.begin(115200);
  mySerial.begin(9600);
  sendDebug("AT");
  delay(2000);
  if(Serial.find("OK")) {
    monitor.println("RECEIVED: OK");
    Serial.println("RECEIVED: OK");
  }
  connectWiFi();
}

unsigned char buf[50];

void loop() {
   while(!mySerial.available());
   if(mySerial.read() == '#') {
     for(int i=0;i&lt;12;i++) {
       while(!mySerial.available());
       buf[i] = mySerial.read();
     }
     buf[3] =0;
     buf[7]=0;
     buf[11]=0;
     p1 = atoi((const char *)&amp;buf[0]);
     p2 = atoi((const char *)&amp;buf[4]);
     p3 = atoi((const char *)&amp;buf[8]);
     delay(1000);
   }

   long int SensorValue=analogRead(temp);
   SensorValue=SensorValue*5000;
   SensorValue=SensorValue/1024;
   SensorValue=SensorValue/10;
   SensorValue=SensorValue*9;
   SensorValue=SensorValue/5;
   SensorValue=SensorValue+32;
   String tempF=String(p1);
   String tempFF=String(p2);
   String tempFFF=String(p3);
   String tempFFFF=String(SensorValue);

   for(int j=0;j&gt;-1;j++) {
     **j= Serial.read(int p1, int p2, int p3);**
   }
   while(Serial.available()==j)
     updateTemp(tempF,tempFF,tempFFF,tempFFFF);
   while(1) {}
 }

 void updateTemp(String tempF1 ,String tempF2, String tempF3,  String tempF4) {
   String cmd = "AT+CIPSTART=\"TCP\",\"";
   cmd += "api.thingspeak.com";
   cmd += "\",80";
   sendDebug(cmd);
   delay(1000);
   if(Serial.find("Error")) {
     monitor.print("RECEIVED: Error");
     Serial.print("RECEIVED: ERROR");
     return;
   }
   cmd = GET;
   cmd += tempF1;
   cmd += "&amp;field2=";
   cmd += tempF2;
   cmd +="&amp;field3=";
   cmd +=tempF3;
   cmd +="&amp;field4=";
   cmd +=tempF4;
   cmd += "\r\n";
   Serial.print("AT+CIPSEND=");
   Serial.println(cmd.length());
   if(Serial.find("&gt;")) {
     monitor.print("&gt;");
     monitor.print(cmd);
     Serial.print(cmd);
   } else {
     sendDebug("AT+CIPCLOSE");
   }
   if(Serial.find("OK")) {
     monitor.println("RECEIVED: OK");
   } else {
     monitor.println("RECEIVED: Error");
   }
 }

 void sendDebug(String cmd) {
   monitor.print("SEND: ");
   monitor.println(cmd);
   Serial.println(cmd);
 }

 boolean connectWiFi() {
   Serial.println("AT+CWMODE=1");
   delay(2000);
   String cmd="AT+CWJAP=\"";
   cmd+=SSID;
   cmd+="\",\"";
   cmd+=PASSWORD;
   cmd+="\"";
   sendDebug(cmd);
   delay(1000);
   if(Serial.find("OK")) {
     monitor.println("RECEIVED: OK");
     return true;
   } else {
     monitor.println("RECEIVED: Error");
     return false;
   }
 }
</code></pre>

<p>This is my code. I am getting an error as "exit status 1 
expected primary-expression before 'int'"</p>

<p>Please help me.</p>

<p>Thank you.</p>
 6628: <p>You are doing Serial.read() wrong with:</p>

<pre><code>Serial.read(int p1, int p2, int p3);
</code></pre>

<p><code>Serial.read()</code> takes no parameters per <a href="https://www.arduino.cc/en/Serial/read" rel="nofollow noreferrer">https://www.arduino.cc/en/Serial/read</a></p>

<p>Maybe you want to try <code>parseInt()</code> instead?</p>
 -1: <p>Your problem is that your are using asterisks ("*")</p>

<pre><code>   for(int j=0;j&gt;-1;j++) {
     **j= Serial.read(int p1, int p2, int p3);**
   }
</code></pre>

<p>The asterisk in C/C++ is the <strong>pointer operator</strong>. You use to get the value pointed by a pointer.</p>

<p>The expression <code>**j</code> means that <code>j</code> is a pointer to a pointer that points something. That's is meaningless here.</p>

<p>Then, the last <code>**</code> is readed as another pointer to a pointer, and the compiler is expecting a variable or expression that give the value for the pointer, but found "}", which is an error.</p>

<p>You probably tried to comment out that line of code after the compiler barks at the <code>Serial.read()</code>, which, as Dave X pointed out, is illegal, because <code>Serial.read()</code> takes no arguments.</p>

<p>And, the syntax <code>function(int x)</code> is only use for declaring a function, not for calling one.</p>
