I have written a basic socket programming and i can execute it very well, but now i dont want to hard code the client and server's IP address and port no in the program. I want to intialize the ip add and port numbers from a text file and set tht as configuration file. Can anyone give me an idea about how i should write the text file which will contain the ip address and port numbers and what command do i use it to open this text file in server and client program.
This is what i did in my client and server codes
service.sin_addr.s_addr = inet_addr("127.0.0.1");
service.sin_port = htons(55555);
please help me