I'm not sure what you mean by the "process behind it". Did you read the wiki page? I doubt I know anything that isn't there! You can search for "ansi escape codes" for other sources. If you have any specific questions about the code I posted I'll answer them.
For updating a single cell in your displayed 2d array you could position the cursor at the right row/col and overwrite the value there (ensuring what you write has the same number of characters so it completely overwrites the old value).
Code:
#include <stdio.h>
#define SIZE 10
#define FIELD_WIDTH 4
#define CSI "\033["
void clear_screen() { printf(CSI "2J" CSI "H"); }
void clear_to_eol() { printf(CSI "K"); }
void move_cursor(int row, int col) { // row/col are zero-based!
printf(CSI "%d;%dH", row + 1, col + 1); // but are 1-based here
}
int main() {
clear_screen();
// make a grid of numbers
for (int r = 1; r <= SIZE; r++) {
for (int c = 1; c <= SIZE; c++)
printf("%*d", FIELD_WIDTH, r * c);
putchar('\n');
}
while (1) {
int row, col, val;
printf("Enter row col val: ");
if (scanf("%d%d%d", &row, &col, &val) != 3)
break;
move_cursor(row, col * FIELD_WIDTH); // zero-based!
printf("%*d", FIELD_WIDTH, val);
move_cursor(SIZE, 0); // move cursor back to bottom
clear_to_eol();
}
putchar('\n');
return 0;
}