signed long long value = -2147483648;
cout << ((signed long long)value);
outputs 2147483648 (no minus sign), why?
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.
2147483648cannot be represented in a 32-bit signed integer, so it is converted to an unsigned, then unary minus is applied (which doesn’t change anything), and then it is assigned to the signed long long. Use-2147483648LL