Char array/String to int conversion

Hello. I'm working on this code:

const byte numChars = 32;
char receivedChars[numChars];   // an array to store the received data

boolean newData = false;

void setup() {
    Serial.begin(9600);
    Serial.println("<Arduino is ready>");
}

void loop() {
    recvWithEndMarker();
    showNewData();
}

void recvWithEndMarker() {
    static byte ndx = 0;
    char endMarker = '\n';
    char rc;
    
    while (Serial.available() > 0 && newData == false) {
        rc = Serial.read();

        if (rc != endMarker) {
            receivedChars[ndx] = rc;
            ndx++;
            if (ndx >= numChars) {
                ndx = numChars - 1;
            }
        }
        else {
            receivedChars[ndx] = '\0'; // terminate the string
            ndx = 0;
            newData = true;
        }
    }
}

void showNewData() {
  String num = String(receivedChars);
  long numeretto = num.toInt;
  
    if (newData == true) {
        Serial.print("This just in ... ");
        Serial.println(receivedChars);
        newData = false;
    }
}

What I want is to get a number in the Serial monitor and turn on and off a led N times (n = monitor input).
The monitor can only send chars, that I save into received chars. In the showNewData function I tried to convert it to a string and then to an int, but I get this error:

cannot convert 'String::toInt' from type 'long int (String::)() const' to type 'long int'

What do I have to do? Thanks

Not:

  long numeretto = num.toInt;

But:

  long numeretto = num.toInt();

Assume that you have sent 12 from the InputBox of the Serial Monitor with Newline option active. In the UNO, receive the incoming data bytes by executing the following instruction:

Serial.readBytesUntil('\n', myData, 20);

where, received bytes will be saved in a null-byte terminated character type array named myData[]. After that, apply the following code to get 12 back.

int x = atoi(myData);

Full Codes:

char myData[20] = "";

void setup()
{
   Serial.begin(9600);
}

void loop()
{
   byte x = Serial.available();
   if(x !=0)
   {
       Serial.readBytesUntil('\n', myData, 20);
       int y = atoi(myData);
   }
}