Hi i have a class with a delegate as a parameter as shown in the code, but i get the errors
Error 1 Type expected ...\Classes\Class1.cs 218 33 Classes and
Error 2 ; expected ...\Classes\Class1.cs 218 96 Classes. How do i fix the issue? Thanks in advance! I’m trying to pass it byref so when a class initializes, some method of it is attached to the delegate.
public constructor(ref delegate bool delegatename(someparameters))
{
some code
}
You cannot declare the delegate type in the constructor. You need to first declare the delegate type, and then you can use it in the constructor: