object value changes when another object is manipualated.
I want to make it to where the values inside m don't change.
thanks. here's the code
private static void AddMultipleOfRowTo(Matrix m)
{
Matrix n = m;
MultiplyRow(n);
bool f = false;
string choice;
int row = 0;
bool invalidChoice = false;
Console.WriteLine("Which row would you like to add this row to.");
while (!f)
{
choice = Console.ReadLine();
try
{
row = Convert.ToInt32(choice);
if (row < 1 || row > m.Elements.GetLength(0))
invalidChoice = true;
else
{
f = true;
}
}
catch
{
Console.WriteLine("Your input must be an integer.");
Console.WriteLine("Try again.");
f = false;
}
if (invalidChoice == true)
{
Console.WriteLine("Your choice was invalid.");
Console.WriteLine("Please read your options.");
}
}
for (int i = 0; i < m.Elements.GetLength(0); i++)
{
m.Elements[row - 1, i] = (n.Elements[row - 1, i]) + (m.Elements[row - 1, i]);
}
}

