i am writing a simple code by using ref keyword. As i understand struct can be really slow on copying things. In order to make it faster you should use ref. So i wrote this simple code below.
using System;
namespace ConsoleApplication4
{
class Program
{
public static void returns(ref s s1)
{
for (int i = 0; i < 100;i++)
{
s1.z += i;
}
}
static void Main(string[] args)
{
s s1 = new s();
returns(ref s1);
}
}
}
it gave me the error "Error 1 Inconsistent accessibility: parameter type 'ref is less accessible than method". I checked one of stackoverflow question. Using ref seemed like that. What is my mistake here. Can you give me any advice.
Thanks in advance.