Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Normal
I'v created IComparer for SortedList collection but compiler do not like how I'm using it:class IntReverse : IComparer{ public int Compare(object x, object y) { int xcopy = (int)x, ycopy = (int)y; if (xcopy > ycopy) return -1; else return 1; } } class Program { static void Main() { IComparer comp = new IntReverse(); SortedList<int,string> a = new SortedList<int, string>(comp); } } Error message:Error CS1503 Argument 1: cannot convert from 'System.Collections.IComparer' to 'int'Continue reading...
I'v created IComparer for SortedList collection but compiler do not like how I'm using it:
class IntReverse : IComparer
{ public int Compare(object x, object y)
{ int xcopy = (int)x, ycopy = (int)y;
if (xcopy > ycopy) return -1; else return 1;
}
class Program
{ static void Main()
{ IComparer comp = new IntReverse();
SortedList<int,string> a = new SortedList<int, string>(comp);
Error message:
Error CS1503 Argument 1: cannot convert from 'System.Collections.IComparer' to 'int'
Continue reading...