Library and submission type parameter field

I greet.
What am I doing wrong that I report library mistake when declaring local parameters array element.

SerialStep.cpp

i#include <Arduino.h>
#include "SerialStep.h"

SerialStep::SerialStep(byte pin_STC, 
                                 byte pin_SHCP, 
                                 byte pin_DS, 
                                 byte engine[])
{
  byte _pin_STC = pin_STC;      // OK
  byte _pin_SHCP = pin_SHCP;  // OK
  byte _pin_DS = pin_DS;         // OK
  byte _engine[] = engine[];     // e r r o r !!!
}

SerialStep.h

#ifndef SerialStep_h
#define SerialStep_h

#include "Arduino.h"

class SerialStep
{
  public:
    SerialStep (byte pin_STC,
                     byte pin_SHCP, 
                     byte pin_DS, 
                     byte engine[]);
  private:
};

C:…\Documents\Arduino\libraries\SerialStep\src\SerialStep.cpp:
In constructor ‘SerialStep::SerialStep(byte, byte, byte, byte, byte*, byte*)’:

C:…\Documents\Arduino\libraries\SerialStep\src\SerialStep.cpp:15:27:
error: expected primary-expression before ‘]’ token

byte _engine = engine;
^

exit status 1
Compile error.

What is the correct code?
Thank you.

byte _engine[] = engine[];You can’t copy one array to another like that.

So how do I adjust?

You could copy one to another byte by byte using a for loop or use memcpy() to do it all at once. Either way you will need the destination to be the same size, or possibly larger, than the source.

I would make _engine a pointer and pass in a pointer to the array you have. That way you don't have to copy anything, just use the array that the user created right where it is.

Can it be this way?

#include <Arduino.h>
#include "SerialStepper.h"

SerialStepper::SerialStepper(  byte pin_STC, 
                               byte pin_SHCP, 
                               byte pin_DS, 
                               byte pocet_M, 
                               byte motory[], 
                               byte smerM[])
{
   
  byte _pin_STC = pin_STC;
  byte _pin_SHCP = pin_SHCP;
  byte _pin_DS = pin_DS;
  byte _pocet_M = pocet_M;
  byte *_motory = motory; //  OK?
  byte *_smerM[] = smerM;   // OK? 
}

Declare your function like this:

SerialStepper::SerialStepper(  byte pin_STC,
                               byte pin_SHCP,
                               byte pin_DS,
                               byte pocet_M,
                               byte *motory,
                               byte *smerM)
{