static void SetData(ValueClass newValue1, Value newValue) { int x = newValue1.GetValueX(); int y = newValue1.GetValueY(); newValue1.newMember(); newValue.newMember(); newValue1.Modify(); newValue.Modify(); newValue1.Show(); newValue.Show(); newValue1.newMember(); newValue.newMember(); }
{/*This program contains a class and a structure assigning values to member variables.*/ static void Main(string[] args) { int value1, value2; Console.WriteLine("Enter values:"); value1 = int.Parse(Console.ReadLine()); value2 = int.Parse(Console.ReadLine()); Value newValue = new Value(value1, value2); newValue.Show(); ValueClass newValue1 = new ValueClass(value1 + 10, value2 + 10); newValue1.Show(); SetData(newValue1, newValue); Console.ReadLine(); }