I'm trying to send data over network from a Java program to a C program. But I don't know which type of data to use. I tried with a char.
Here is my Java code :
DataOutputStream dos = new DataOutputStream(sock.getOutputStream());
char c = 'c';
dos.writeChar(c);
And my C code :
char buffer[256];
bzero(buffer, 256);
read(newsockfd, buffer, 255);
printf("Here is the message: %c\n", buffer[0]);
"Here is the message" print nothing. I don't know if buffer[0] is empty or if the type is not compatible.
readreturn?