I need to assign constant value in integer (or other data type).
I got “Cannot convert …” error with the assignment.

Casting doesn’t seem to work with “Overflow …” error.

What’s wrong with this?
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’ve defined too many
Fs in the constant. Using0xFFFFFFFFthe compiler must choose a a storage location that supports a positive value of0xFFFFFFFF. The max positive value of anInt32is instead0x7FFFFFFFand hence the compiler correctly errors. The only types which can hold0xFFFFFFFFareuintor one of the 64 bit storages.To fix this just use
Int32.MaxValue