How can I give a custom ip to my program, I've built a chat app, not the whatsapp, jus cui based simple chat app, coz imma beginner, I've used inet_addr() function, but it says can't assign ip, it only allows localhost IPs(127.0.0.1 to 127.0.0.254), can you please tell me, what should I do. please…. here's my code : -
here's the problematic code :-
struct sockaddr_in serv_addr,cli_addr;
int serv_socket,cli_socket,cli_len = sizeof(cli_addr);
char buff[256];
serv_addr.sin_port = htons(32000);
serv_addr.sin_addr.s_addr = inet_addr("127.0.0.1");
serv_addr.sin_family = AF_INET;
if the above code didn't helped then, here's my link maybe you will find something interesting there, and please gimme a solution, I really need help please.......