Problem receiving string through the serial port

Basically, what I’m trying to do is to make the Arduino send “Requesting: 1”. Then I will type a number, 12345, for example. And then it should answer “Received: 12345”. And now send “Requesting: 2”

But I can’t manage to format the individual characters inside the string variable.

const char STOP_BYTE = '\n';
char buffer[20];
void setup(){

void loop() {
  char DataReceived[15];
  static byte i=0;
  for (int counter=1;counter<6;counter++){
    Serial.print("Requesting: ");//standard request message
    if (Serial.available() > 0) {
    char inByte =;
    if (inByte==STOP_BYTE) { // We've received the end of our input
      buffer[i] = '\0'; // null terminate the string
      int data = atoi(buffer);
      // Do something with the data int
      i=0; // reset the index
    } else {
      buffer[i++] = inByte; // add character to buffer and increment index
    Serial.print("Received: ");
    for(int x=1;x<16;x++){

Read this: