Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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

by sam_bakki (Pilgrim)
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 :(

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://959279]
[Corion]: So now there will be the fun of me explaining to the project that $other_project had low priority because $project has high priority. If $project picks up the task from $other_project, they also will need to reprioritize my tasks to get that done...
[Corion]: ... of course at the cost of something else on my list of tasks for $project, as there only is a finite amount of days until $deadline.

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2017-08-17 12:24 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (287 votes). Check out past polls.