In C and C++ you can tell the compiler that a number is a ‘long’ by putting an ‘l’ at the end of the number. e.g long x = 0l;
How can I tell the C# compiler that a number is a byte?
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.
According to the C# language specification there is no way to specify a byte literal. You’ll have to cast down to byte in order to get a byte. Your best bet is probably to specify in hex and cast down, like this: