When you use strcat(A, B), the null char ('\0') marking the end of the A string gets replaced by the first char in B and all the following chars in B get appended from this point onward to A (that must be large enough to hold the result of the concatenation or undefined behaviour could occur).
After the strcat() call, A is no longer what you initially defined it to be, but a new string resulting from the concatenation.
If you want to reverse this, a simple solution is to keep A's lenght before doing the concatenation using strlen():
int A_len = strlen(A);
This way to reverse strcat(A, B) you only need to set the null char where it used to be before the concatenation:
A[A_len] = '\0';
After this replacement, strcat(A, C) returns hellojames.