Y
Yanb
Hi, I'm new to c, so please excuse, if this is silly ;-)
I made a C function, which takes IP adress from string and converts to unsigned long int. Everything
works, but I found that the "counting" part part works only with this:
numericip=atoi(textip[0])*256*256*256+atoi(textip[1])*256*256+atoi(textip[2])*256+atoi(textip[3]);
When I wrote *(256^3), I got fake results. I'd like to use something more sophisticated, instead of 256*256
*256, which does look silly ;-) (Just curious, what if I'd ever need to make 100th power of 256 ;-) )
Thank you in advance.
I made a C function, which takes IP adress from string and converts to unsigned long int. Everything
works, but I found that the "counting" part part works only with this:
numericip=atoi(textip[0])*256*256*256+atoi(textip[1])*256*256+atoi(textip[2])*256+atoi(textip[3]);
When I wrote *(256^3), I got fake results. I'd like to use something more sophisticated, instead of 256*256
*256, which does look silly ;-) (Just curious, what if I'd ever need to make 100th power of 256 ;-) )
Thank you in advance.