I have two chars = 4 bytes, that representing integer value (geted from stream).
How can I copy these into a primitive int variable?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You are better off reading 4 bytes as an
intfrom the start. However to turn two char into an int you can useYou need to know whether the order is little or big endian.