moving a pointer - what happens with the memory?

I have:

char *pChar = "This is my string";

I want to cut the first 4 characters from a string, so I'm doing this to pChar:

pChar = pChar + 4;

My question is, what happens with those 4 bytes - does Arduino know that it's available for use again?

No, it stays in the memory without any change. Somewhere in the memory is placed the string (at start time). The pointer is its address and takes another place in the memory or it is temporarily in registers.

Ok, so if I do that over and over again I'll eventually run out of memory?

void test {
char *pChar = "This is my string";

while (1=1) {
pChar = pChar + 4;
strcat(pChar,"AAAA"); //adding 4 chars to replace the ones cut

}
}

You won't "run out of memory", but pChar keeps increasing in that code. It will overwrite memory not originally allocated for the string. This will lead to unpredictable (and eventually catastrophic) results.

This code is fine (but pointless):

void test() {
  char *pChar = (char *)"This is my string";
  while (1) {
    memcpy(pChar+4, "AAAA", 4); //adding 4 chars to replace the ones cut
  }
}
void setup() {
  test();
}

void loop() {
}

Ok thanks, yes quite pointless but just want to confirm it'll work.

First of all the string is a constant and should never be changed although the C it allows. If any manipulation with the string is needed during program run, then it should be copied into the buffer with appropriate/sufficient size and any changes must stay in exact buffer margins (programmer have to care). Any overlapping (before or behind) leads to data harm and to unpredictable results as was mentioned above.

BTW: The statement while(1=1) is not correct. The = is assignment while the == is for equality comparison. It should be while(1 == 1). However, while(1) is the same in result, as above in post from @grvalvo.
Eventually, the statement for( ; ; ) can be used by the same manner.

heinduplessis:
My question is, what happens with those 4 bytes - does Arduino know that it's available for use again?

They're not 'cut', they're still there holding the contents you gave them. You just don't see them because pChar now points to a different spot in the array.

char *pChar = "This is my string";

void setup() {
  Serial.begin(115200);
  Serial.println("------------------------------");
  printpChar();
  pChar = pChar + 4;
  printpChar();
  strcat(pChar, "AAAA"); //adding 4 chars to replace the ones cut
  printpChar(); 
  pChar = pChar - 4;  // go back to pointing to the original string
  printpChar();
}

void loop() {
 }

void printpChar() {
  Serial.print(pChar);
  Serial.print("\t length is ");
  Serial.println(strlen(pChar));
  Serial.println();
}