mySerial functions (HELP!)

Hi. I've 2 arduinos (nano and Leonardo) connected with mySerial. Here is the code from the first one (sends values). The values are read with Wire and then stored in the variable c[X]. "c" has position 0 to 9 so 10 positions. Each c[X] position is a byte (stores numbers from 0 to 255). Then, the variable c is sent to the second arduino using mySerial.

void loop() {
Wire.requestFrom(4,10); //RECIBIR INFORMACION DEL CONTROLADOR
while(Wire.available()){
     for(i=0;i<=9;i++){
     c[i] = Wire.read(); //GUARDAR LECTURA EN VARIABLE C
     Serial.println(c[i],DEC); //MOSTRAR LECTURA EN MONITOR SERIAL (A DECIMAL)
     }}            
Serial.print("\n");
mySerial.write(c,10);
}

The code of the second one is the following:

void loop(){

if(mySerial.available()){
numero=mySerial.read();
 Serial.println("RECIBO");
 Serial.println(numero);
 }  
 }

I receive correctly the values of the variable "numero" but I only want the values that are in the c[2],c[3],c[4],c[5] from the first arduino. How can I store only this positions?

Now edit your post to get rid of the italics, please

I don't have activated the italics but they appear.

Welcome to the Forum. Please read the two posts at the top of this Forum by Nick Gammon on guidelines for posting here, especially the use of code tags which make the code looklike thiswhen posting source code files. Also, before posting the code, use Ctrl-T in the IDE to reformat the code in a standard format, which makes it easier for us to read.

If you have already posted without using code tags, open your message and select "modify" from the pull down menu labelled, "More", at the lower left corner of the message. Highlight your code by selecting it (it turns blue), and then click on the "</>" icon at the upper left hand corner. Click on the "Save" button.

When you have it open, you should be able to see the italics tags and remove them. Or just delete and copy directly from your program source.

margarmes:
I don't have activated the italics

Oh yes you did. An array index of i does it.
Please edit your post and put the code in code tags using the </> icon above the editor window

I think now is correct. My program is working but when I am storing each C[x] value it appears without order. I mean C[0] for example in write appears as C[4] when read. How can I syncronize it???

I only want the values that are in the c[2],c[3],c[4],c[5] from the first arduino.

So change the for loop to only output the values that you want.

     for(i = 2; i <= 5; i++)

I mean C[0] for example in write appears as C[4] when read

Not if your code is correct.

One thing you need to understand is that serial data is NOT guaranteed to be delivered. The process follows the United States Post Office policy, where the guarantee only to try, not to succeed.

You MUST be prepared to deal with data loss, which generally means not sending binary data over the serial port.