i'm quite new to socket programming and my task is to change a windows code into linux. There i got a problem and i hope you can help me. I got this code segment, where the four parameters of the IP4-address get transfered from a function to my socket code (in windows with the header winsock.h).
struct sockaddr_in server;
server.sin_addr.S_un.S_un_b.s_b1 = (unsigned char)a1;
server.sin_addr.S_un.S_un_b.s_b2 = (unsigned char)a2;
server.sin_addr.S_un.S_un_b.s_b3 = (unsigned char)a3;
server.sin_addr.S_un.S_un_b.s_b4 = (unsigned char)a4;
My question is, if there is a similar type of way to transfer these parameters to the linux socket code.
struct sockaddr_in server;