Compound data type: Difference between revisions
Content added Content deleted
(Reader included) |
|||
Line 202: | Line 202: | ||
# Please verify the code above... (from CPAN docs, not tested) |
# Please verify the code above... (from CPAN docs, not tested) |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
# Using Inline::Struct with C code embedded |
# Using Inline::Struct with C code embedded |
||
use Inline C; |
use Inline C; |
||
Line 233: | Line 227: | ||
my $point = pack("ii", 1, 2); |
my $point = pack("ii", 1, 2); |
||
my ($x, $y) = unpack("ii", $point); |
my ($x, $y) = unpack("ii", $point); |
||
⚫ | |||
⚫ | |||
# Using Win32::API::Struct |
# Using Win32::API::Struct |
||
Line 268: | Line 259: | ||
#endif |
#endif |
||
typedef struct Point { int x; int y; } Point; |
typedef struct Point { int x; int y; } Point; |
||
### The code below does not create a "binary" like structure. |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
==[[PHP|PHP TODO]]== |
==[[PHP|PHP TODO]]== |