Click here to Skip to main content
15,891,717 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to convert a negitave number to byte ?
Posted

1 solution

VB
Dim i As Integer = -6
Dim b As Byte = Convert.ToByte(i And &Hff)
 
Share this answer
 
v2
Comments
srilekhamenon 18-Feb-12 4:58am    
got a error:- Arithmatic operation result in an overflow
OriginalGriff 18-Feb-12 5:50am    
Answer updated
srilekhamenon 18-Feb-12 6:28am    
Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900