3
I needed to make a comparison of the kind of methods normally created as inList
or something like that. When searching the Microsoft documentation, I found the Array.BinarySearch(T[], T)
. I performed this operation in my code and I was in doubt with the return that was -36.
Array.BinarySearch(new Int32[] { 1, 2, 3, 20, 25, 30, 31, 34, 36, 37, 39, 40, 41, 42, 43, 44, 45, 6, 12, 14, 17, 18, 27, 48, 4, 10, 11, 19, 21, 22, 23, 24, 26, 28, 29, 32, 33, 35, 38, 46, 13, 5, 15, 16, 47, 49, 7, 8, 9 }, clalav_lav)
//O valor da variável clalav_lav é 30 no momento
Why did he return -36, if the value exists in the array?
Gee, in the middle of the rush, I didn’t notice the OBVIOUS! Thank you very much.
– Paulo Freitas