Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial3 Answers
Steven Parker
231,198 PointsJust put the word "public" at the beginning of a declaration.
Monika Valkova
5,121 PointsHi guys, how is Func declared? I find it nowhere in the documentation :'(
Steven Parker
231,198 PointsHere's a link to the definition of Func in the Microsoft documentation. You can see the instructor looking it up at about 2:45 in the video.
Monika Valkova
5,121 Pointsusing System;
namespace Treehouse.CodeChallenges { public class Program { //public delegate int Func<in int, out int> Square (int number); //public delegate int Func<in int,out int>(int number); //public delegate string Square(int number);
public Func<int, int> Square(int number);
static void Main(string[] args)
{
Square = delegate(int number)
{
return number*number;
}
}
}
}
Still doesn't work. (none of the ways I tried to declare it)