storing a number and to compare it

i want to read a data from rfid reader using software serial emulation and i want to compare it.
(i am using arduino leonardo)
i am getting some error

#include <SoftwareSerial.h>

SoftwareSerial mySerial(8,9); // RX, TX
byte A[8];
void setup()  
{
  
  Serial.begin(9600);
  while (!Serial) 
  {
    ; 
  }
  Serial.println("rfid identity value!");
  mySerial.begin(9600); 
}

void loop() 
{
  while(mySerial.available())
{    Serial.write(mySerial.read());
A[8] = mySerial.read();
           if (A[8] == 08160978)
     {
       Serial1.println("acgb");
     }
}}

and the error i am getting is
rfid_input.ino:22:24: error: invalid digit "9" in octal constant

maybe you want to store each digit of the "08160978" into an element of the array?

your "byte A[8]" can store in each element of the array a byte (number from 0 to 255).
also, when on your loop you refer to A[8], you are just actually pointing to the 9th element of your array (first element would be A[0], then A[1],... )

here is the nice Reference page showing how to use arrays with Arduino

The digit 9obviously is not an octal digit - what's the problem?

A[8] doesn't exist in an eight element array, and comparing a byte to anything larger than 255 is never going to work.

if (A[8] == 08160978)

How can a single byte be equal to such a large number?
Also as you define A and an 8 byte array then using A[8] is the 9th element in that array, array indices go from 0 to 7

This bit of code:-

Serial.write(mySerial.read());
A[8] = mySerial.read();

Prints out every odd numbered byte you receive and assigns ALL the even numbered bytes into one byte just outside your array.

You can not get:-

rfid_input.ino:22:24: error: invalid digit "9" in octal constant

With the code you posted. Please post all the code if you want a proper explanation.

08160978

The leading zero says it's an octal value

any other solutions ? :~

equipmentimes:
any other solutions ? :~

A few hours of study about basic programming concepts seems to be indicated.

You need to collect each character that is received and store it in a separate element of your array - assuming that the RFId device sends its data that way.

Then you need to figure out how to compare the contents of your array with the value you are interested in. This could be done either by treating your value as a series of separate characters to be compared with the characters in the array. Or by converting the characters in the array into a number and comparing that number with your value. No doubt you will have learned already not to precede number with leading zeros.

...R

equipmentimes:
any other solutions ? :~

Other than not making stupid mistakes in the code? I think not.
Other ways of writing the code plenty.