Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

how to unpack a C struct with length array preceding data array

by johnlumby (Initiate)
on May 22, 2013 at 19:28 UTC ( #1034810=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      {   
       short lengths[2];
    ...
      }
    where there are two items in data,  of length
    lengths[0] and lengths[1] respectively.
    
  2. or download this
    eval('($junk1 , $junk2, $data0, $data1) = unpack "ssA' . $data0_length
    + . "A" . $data1_length . '",$rcvd_buf;');
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1034810]
Approved by Paladin
Front-paged by davido
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2014-12-27 11:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls