data_size = recvfrom(sock_raw , buffer , 1024, 0 , &saddr , (socklen_t*)&saddr_size);
here is the recvfrom function where I want to create a struct to 'saddr' and 'saddr_size', which is declared in main () as follows
struct sockaddr saddr; int saddr_size; saddr_size = sizeof saddr;
and instead of the buffer mentioned in the api () entry below, I have to use a structural variable.
int cont= write(logfile,buffer,data_size);
My question is: below I used struct.Is is this a way to define a structure for the following fields? Is this announced correctly? if not, please someone help me fix this.
struct data{ unsigned char buffer[1024]; unsigned long int saddr;
source share