Hi,
i am writing my first program regarding sockets in C and i have this problem which i cannot unfortunately resolve...any ideas pls??
Storage size of 'sin' isn't known
Code:
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <string.h>
int main(){
struct hostent *phe;
struct sockaddr_in sin; //problem is here........
char *host;
int s, rc, type;
host = "tombaker.cis.um.edu.mt";
memset(&sin, 0, sizeof(sin));
sin.sin_family = AF_INET;
sin->sin_port = 7; //ECHO service
sin.sin_addr = inet_makeaddr(
inet_network("193.188.43.36"),
inet_addr("193.188.43.36"));
s= socket(PF_INET, SOCK_STREAM, 0);
rc = connect(s, (struct sockaddr *)&sin, sizof(sin));
if (rc != 0)
printf("failed");
else (printf("connected"));
}