What is the best way to convert a char array (containing bytes from a file) into an decimal representation so that it can be converted back later?
E.g “test” -> 18951210 -> “test”.
EDITED
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.
It can’t be done without a bignum class, since there’s more letter combinations possible than integer combinations in an
unsigned long long. (unsigned long longwill hold about 7-8 characters)If you have some sort of bignum class:
Note: the string to uint conversion will lose leading NULLs, and the uint to string conversion will lose trailing NULLs.