C# Querying With LINQ Functional Programming in C# Delegates

Rhett Herring
PRO
Rhett Herring
Pro Student 7,140 Points

is this not what we are after here:

Declare a delegate named MathOperation inside the Program class that has an integer return type and takes an integer parameter named number.

This is wrong? I'm missing something but what?

Program.cs
using System;

namespace Treehouse.CodeChallenges
{
    class Program
    {

        delegate void MathOperation(int number);

        static void Main(string[] args)
        {

        }
    }
}

2 Answers

andren
andren
28,375 Points

The challenge specifies that the delegate has to have an integer return type:

  delegate void MathOperation(int number);

You are using void as the return type, that is what is causing the error.

using System;

namespace Treehouse.CodeChallenges
{
    class Program
    {

        delegate int MathOperation(int number);

        static void Main(string[] args)
        {

        }
    }
}