converting data in an array after a wireless transmission

HI, I'm using a nRF24L01 to send a value between to Arduino's. The problem is on the receiver side the data is in an array format. I want to have the value stored as a regular int. How do you convert an array like this to a regular int?

I am new to this so.. would there be a way just to transmit the INT not in an array format?

This is the receiver

#include <SPI.h>
#include <Mirf.h>
#include <nRF24L01.h>
#include <MirfHardwareSpiDriver.h>


char rec[16];

int data[16];
int numbers[3];
void setup(){
  
  Serial.begin(9600);
  pinMode(4, OUTPUT);
   
    Mirf.spi = &MirfHardwareSpi;
    Mirf.init();
   Mirf.setRADDR((byte *)"serv1");
    Mirf.payload = 16;
   
   char data[Mirf.payload];
  
  Mirf.config();
}

void loop(){
  
   data[Mirf.payload];
  
  if(!Mirf.isSending() && Mirf.dataReady()){
  }
    while(!Mirf.dataReady()){
    }
    Mirf.getData((byte *) &rec);


   
      Serial.print(rec[0]);
      Serial.print(rec[1]);
      Serial.println(rec[2]);
  
    
}

Here is the transmitter

#include <SPI.h>
#include <Mirf.h>
#include <nRF24L01.h>
#include <MirfHardwareSpiDriver.h>

int rate = 0;
char buffer[16];
char data[16];



void setup(){
  Serial.begin(9600);
 
  Mirf.spi = &MirfHardwareSpi;
  Mirf.init();
  Mirf.setRADDR((byte *)"clie1");
  Mirf.payload = 16;
  Mirf.config();
  }

void loop(){
rate = rate + 1;
    

    Mirf.setTADDR((byte *)"serv1");


    data[Mirf.payload];

sprintf(buffer,"%1d",rate);   


    Mirf.send((byte *) &buffer);


    while(Mirf.isSending()){
    }

    
    delay(1000);

    }

Lose the array.

int rate;
...
Mirf.payload = sizeof(rate);
...
Mirf.send(&rate);
...
Mirf.getData(&rate);

Also please consider using the "Auto-Format" command on code before posting to make it easier for folks to read.

Thanks, i tried this. I get an error compiling when I try to put an int directly into the Mirf.send function. I found another post on converting array into int. Its ugly but it works. I did not realize there was a auto format tool. I will use it from now on. Thanks for the pointer.

char buffer[3];
  buffer[0] = rec[0];
  buffer[1] = rec[1];
  buffer[3] = '\0';
  int  n;
  n = atoi(buffer);

  Serial.println(n);

instrumentek:
Thanks, i tried this. I get an error compiling when I try to put an int directly into the Mirf.send function.

Aargh, Mirf kills me. I suppose it prefers this...

Mirf.send((byte*)&rate);