Since the size of the data is fixed, one simple way of writing this entire array into a file is using the binary writing mode:
FILE *f = fopen("client.data", "wb");
fwrite(clientdata, sizeof(char), sizeof(clientdata), f);
fclose(f);
This writes out the whole 2D array at once, writing over the content of the file that has been there previously.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…