Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
XP is just a number
 
PerlMonks  

Re^4: How to use 'unsigned char' C data type with Win32::API (&255)

by sam_bakki (Monk)
on Mar 13, 2012 at 09:41 UTC ( #959279=note: print w/ replies, xml ) Need Help??


in reply to Re^3: How to use 'unsigned char' C data type with Win32::API (&255)
in thread Solved: How to use 'unsigned char' C data type with Win32::API

Hi tye

I suppose to get like below C code's API call.

# C Code # printf ("\n \n DEV: %d , %c , %x ", i2cGetDeviceAddress(),i2cGetDevi +ceAddress(),i2cGetDeviceAddress()); # # Output: DEV: 70 , F , 46

I used following code get rid of un initialized bytes

$ret = unpack ('C',pack ('i*',$ret)); #This gives 152 but this is not +i want :(


Comment on Re^4: How to use 'unsigned char' C data type with Win32::API (&255)
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://959279]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (21)
As of 2014-04-16 14:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (431 votes), past polls