Thread Integer zu Byte (6 answers)
Opened by maart at 2012-08-11 09:25

topeg
 2012-08-11 13:24
#160822 #160822
User since
2006-07-10
2611 Artikel
BenutzerIn

user image
Code (perl): (dl )
1
2
3
4
5
6
7
sub writeInt
{
  my $array=shift;
  my $pos=shift;
  my $value=shift;
  @array[$pos..$pos+3]=unpack('C*',pack('N',$val1));
}


Aufruf:
Code (perl): (dl )
1
2
3
4
my @array;
my $pos=16;
my $val=10;
writeInt(\@array,$pos,$val);

View full thread Integer zu Byte