Hi again,
I have the simple code below, and I receive the error "best overloaded method match has some invalid arguments". I tried to return a string or an int and then it said that I can't implicitly convert void to string. Any ideas on how I can overcome it?
Thanks in advance,
using System;
namespace PrintPattern
{
class Program
{
static void Main()
{
}
static void ReturnPattern(int n)
{
if (n == 0)
{
return;
}
Console.WriteLine("{0}{1}{2}", ReturnPattern(n-1),n,ReturnPattern(n-1)); //error
}
}
}