I don't know if this loop is good practice.
Is there a better way to write to a buffer from another buffer in C?
char temp_clientRecv[512] = {0};
for (int i=0; i<512; i++);
fprintf(stdout,"%c" ,temp_clientRecv[i]);
It will not compile as i is defined in the for loop scope and will not be declared outside this scope.
You do not write from one buffer to another only send the content of the temp_clientRecv out. If the output stream is buffered or not is out of the scope of C language. It depends on hardware, OS and implementation.
fprintf is an overkill.
fwrite(temp_clientRecv, 1, sizeof(temp_clientRecv), stdout);
putchar(temp_clientRecv[i]).char to int due to the dysfunctional behavior of variadic functions. There may be sign extension during the conversion and in case of run-time values, the compiler won't be able to tell. Whereas putchar thanks to its dysfunctional API already takes an int as parameter and how that parameter ended up as int is none of putchar's business.char be converted to int exactly the same way for both putchar and printf %c?putchar existed before function prototypes were a thing, so its parameter has to be an int for backwards compatibility. I don't really see a difference between converting a char to an int to match a parameter type, and converting a char to an int due to default argument promotions. Both putchar and printf %c convert the int to an unsigned char.If you are copying buffer to buffer in RAM without alteration in the data then you should use following code snippet in your code.
#include <string.h>
memcpy(void *dest_str, const void * src_str, size_t n);
This will copy data bytewise.
string.h. There is no need to define it again. Although I think OP meant to write from a buffer to a stream, given the context.
forloop line is a mistake.