read(client_sockfd, &chID, 4);
char newID[4];
for(int i; i<5; i++){
newID[i] = chID[i];
}
I'm reading char chID[4] over a socket. I want to put the first 4 characters into newID. Above is what I've tried, but I get some weird output when I copy newID into a string and print it out. Any guidance?