I'm taking an intro class right now , I'm not having any fun so far. I keep getting implicit conversion. I tried everything from .toString and declaring the array as a string which gives me problems later down when using a foreach statement later on. Can anyone point me in the right direction?
I created an Array.
Contact[] Contacts = new Contact[1];
and I am getting string input from users, using the Console.ReadLine.
Then I created an object.
Contact objContact = new Contact(firstName, lastName, phone, email);
that has those properties from the input.
then I want to add those input into my Contact array.
for (int i = 0; i < Contacts.Length; i++)
{
Contacts[i] = objContact.getFirstName(); objContact.getLastName();
objContact.getPhone(); objContact.getEmail();
}
I get error:
Cannot implicitly convert type 'string' to 'program3.Contact'
what am I doing wrong?