Serial Communication between 2 Arduinos for analogRead value
You'll want to get familiar with the standard C function sscanf().  It does exactly what you're looking for, converts an ASCII string into whatever type you like.

sscanf() API 

The code to read an integer from the serial port would look something like this:

  char recv_buf[10];  int recv_int;
  Serial.readBytesUntil('\n', recv_buf, 9);
  recv_buf[9] = 0;  // make sure it's null terminated
  sscanf(recv_buf, "%d", &amp;recv_int);
  Serial.print("I received: ");
  Serial.println(recv_int);