1
Answer

RE: Converting Objects

Ask a question
Charles

Charles

19y
2.1k
1
I am having a problem converting an object. I am using an associative array as a collection point for instances of my class. I can store various instances into the array and view them in the debugger, but I cannot access them through main as show below. I get the following error message: Cannot implicitly convert type 'object' to 'ConsoleApplication4.Checks Additionally, I even tried changing the return value to the amount. I was able to see the output using console.writeline but could not extract the data to a local field/variable. I could really use some help. public class Checks; { public Checks(int RegisterID, int CatID); { : : } } public class Register { public Register(int size) { : : } } class Class1 { static void Main(string[] args) { Register Pay = new Register (1); Checks temp = new Checks (5,3); temp.Description = “Vons”; temp.Amount = 30.50m; Register [5,3]= temp; temp = new Transactions(6,2); temp. Description = “Home Depot”; temp.Amount = 126.75m; Register [6,2]= temp; temp = Register [5,3]; } }

Answers (1)