Answer:
C.write(sockfd, &data, sizeof(int))
Explanation:
The variable sockfd is a pointer to the socket file descriptor. In order to write an int data over the socket we can use the write API.
write takes the following arguments:
- pointer to socket file descriptor
- starting address of memory location containing the data to be written
- sizeof the data to be written.
In our case this will correspond to:
write(sockfd, &data, sizeof(int));
where data is the variable containing the integer data.