-
Few Socket Questions
I'm 100% new to programming C w/ connecting to other computers, listening for it, sending/recieving packets basically. Well I have this one program send a packet to a server, where there's a program listening for it - if it gets it i know that inet_ntoa(si_other.sin_addr) is the IP that's connecting to the program, how can I make it check this against a string, having a few problems with that o.o Thanks
-
1) Convert an integer to a string and compare them using something like strcmp.
2) Convert the string to an integer, and compare them directly.
Quzah.
-
Thanks a ton :) Got it working
-
One last question, how can I have it read a file line by line to check if a certian string is there? Thanks.
-
If you're already on to sockets I'm gonna assume you already know about the file functions. To find a substring of a string see strstr . If You don't know then check the FAQ and or here .
-