Here is the simplified code of my program. Help sort out, newcomer. Thank you so much!
class program
{
Public struct dttable
{
Float Cash;
int quancar1;
DTTable Calc ()
{
DTTable MYTable = New Dttable ();
int quancar1 = 0
quancar1 = quancar1 + 10;
}
Return (MYTABLE);
}
Public Void SetDatatable (Dttable Indata)
{
Console.WriteLine ("Total: {0}", quancar1);
}
Static Void Main (String [] Args)
{
SETDATATABLE (CALC ()); // Error here
}
}
}
Answer 1, Authority 100%
Make the setDatatable static method (write at the beginning of the STATIC modifier) - and you will be happy.
Judging by the question, you do not understand what an object is, reference type and static class member.
Read the basics.
You can see a small lesson or some other, but be sure to deal with what is Object.