Quote
error CS0120: An object reference is required for the non-static field, method, or property 'HW2.Program.getEntry(string, out double)'
Excerpts of my code:
using System;
namespace HW2 {
class Program {
static int Main() {
double realPart1;
/* snip */
// Get Real part of first number
getEntry("Please enter the Real Part of the first complex number: ", out realPart1); // Error is pointing to this line
/* snip */
return 0;
}//int Main
public void getEntry(string prompt, out double output) {
bool loop;
string input;
do
{
Console.Write(prompt);
input = Console.ReadLine();
loop = !double.TryParse(input, out output);
if (loop)
{
Console.WriteLine("** Error with input.");
}
} while (loop);
}//void getEntry
/* snip */
}//class Program
}//namespace HW2
I really have no idea what that error means to go about fixing it...

New Topic/Question
Reply



MultiQuote



|