Is there a way to copy a whole smaller array into a section of a larger array? For example, if I have an array of 4 characters, and an array of 16, can I copy the 4 characters into the first 4 of the array of 16. Then another 4 characters to 4-7, etc. I know it's possible to do with a loop, but I was wondering if there was a way to do it otherwise. Here's the section of code that I'm trying to get to work.
int numtype = htons(5);
char type[4] = "";
_itoa_s(numtype, type, 4, 10);
message[0] = *type;
I need to convert the message to be sent byte by byte to a server with each 4 bytes containing control messages for the server. This is just one of the 4 of 16 bytes of the whole message.