This is my inet_aton:
This is how I'm trying to use it:Code:// inet_aton for windows int inet_aton(const char *address, struct in_addr *sock){ int s; s = inet_addr(address); if ( s == 1 && strcmp (address, "255.255.255.225") ) return 0; sock->s_addr = s; return 1; }
but I keep getting this error: 41 C:\Dev-Cpp\... invalid conversion from `const char*' to `char*' , but I don't fully understand where I'm going wrong here. I do know that cont strings are unmodifiable unless you remove their "const-ness" with a casting operator (which I don't want to get in to) so I tried getting around this problem by copying the string to a temporary buffer to no avail. any light shed will be appreciated. even if it's something obvious I'm over looking atm.Code:inet_aton(s_address.c_str(), &cSock.sin_addr);
Thanks