C# Function question

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hello,
This should be a simple problem to solve, but I'm fairly new to C# and
have been wracking my brains to no avail. I created a new Console
Application in C# beta 2, and entered the following:

using System;
using System.Collections.Generic;
using System.Text;

namespace Test2
{
class Program
{
static void main (string[] args)
{
string a = "qwert";
string b = GetStuff( );
string c = a + b;
Console.WriteLine(c);
}

public string GetStuff( )
{
string c = "poiuy";
return c;
}
}
}

When I compile this, I get the error: "An object reference is required
for the nonstatic field, method, or property 'Test2.Program.GetStuff( )' for
the line: string b = GetStuff( );

I'm not entirely sure what the problem could be, and would appreciate it
if someone help. Thanks.

Scott


.



Relevant Pages

  • Re: Playing ( crit)
    ... It still strikes me that she should have thought a bit harder before ... she?d said brightly in the tone of voice reserved for small ... wracking my brains for something to say when my turn came. ...
    (rec.arts.sf.composition)
  • Problem of combinatorics
    ... I am wracking my brains about a problem of combinatorics, ... There is a sports team of 21 people. ...
    (sci.math)
  • RE: My entire Excel worksheet scrolls down when I hit the enter key. .
    ... I have been wracking my brains out trying to remember how I cleared this up ... "Miz Nettie" wrote: ... > down in the column should be selected; instead the original cell remains ...
    (microsoft.public.excel.programming)
  • Re: [OT] Stroud Pubs
    ... I'm wracking my brains now to think of one that incorporates both those ... qualities and failing miserably. ...
    (uk.rec.motorcycles)