HELP! Reading from txt file and comparing to input
Hey, possibly a bit of a noob question, i'm not quite sure...
I have to create a sockets program that can identify clients and allow connection to the server based on their IP. I have created a text file that contains two "good" IP addresses:
basically, i need to copy the IP of the potential client trying to connect (maybe hold it in a temp holder?), compare it to the values in the text file and allow or refuse the connection....however, as a new programmer I have pretty much no idea how to do this. :confused:
The psuedocode as I understand it is as follows:
copy their_addr to temp holder(tempAdd)
while file != EOF
if text line!= tempAdd
go to next line
if EOF -> refuse connection
else if line==tempAdd
this may not be accurate but it gives you the idea, any help on this would be very appreciated...