I’ve been trying to do this but I wasn’t able to find any good source for it.
Basicly, I want to convert a char* variable (byte array) into an int and vis-versa.
Thanks.
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.
If you’re trying to convert a byte array into an int it is sufficient to use a reinterpret_cast. Technically, this is UB, but if you know the bytes are in the right format, it usually results in exactly what you’re asking for.
This is while noting the difference between a char* STRING and a char* BYTE ARRAY.