How to convert an int[,] to byte[] in C#?
Some code will be appreciated
EDIT:
I need a function to perform the following:
byte[] FuncName (int[,] Input)
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.
Since there is very little detail in your question, I can only guess what you’re trying to do… Assuming you want to “flatten” a 2D array of ints into a 1D array of bytes, you can do something like that :
Note the call to
Cast: that’s because multidimensional arrays implementIEnumerablebut notIEnumerable<T>