How to convert from long long to int and the other way back in c++ ??
also what are the properties of long long , especially its maximum size,
thank in advance ..
How to convert from long long to int and the other way back in
Share
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.
Type long long is typically 64 bits.
Type int is likely to be 32 bits, but not on all machines.
If you cast an int to a long long, you can do
and it will be just fine. If you go the other direction, like
and the int is smaller than 64-bits, it won’t be able to hold all the information, so the result may not be correct.