
May 9th, 2008, 01:01 AM
|
 |
Banned ;)
|
|
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
|
|
Quote: | Originally Posted by arbituator Hi,
First time post, hopefully this won't hurt too bad...
I have the following Ruby function,
def convert(num)
return [num].pack("N")[1,3]
end
My question is what would the equivalent C function of this be?
More specifically I have an idea of what it does, but I'm not completely sure.
Any and all help would be appreciated.
-Arbituator |
C equivalent:
Code:
#include <arpa/inet.h>
....
...
return htonl(num);
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month
|