Hi
Im having this issue with my code. Cannot implicitly convert type 'string' to 'Event' (Class) - Thats the error message. Im trying to save an object of my class to an array but its coming up with this message and I dont see why it cant do it because it allows me to add my class Event to an array? Heres a part of my code:
class Event
{
private string myListofAthletes = "N/A";
public string ListofAthletes
{
get
{
return myListofAthletes;
}
set
{
myListofAthletes = value;
}
}
}
Event[] ListofAthletesArray = new Event[50];
Console.WriteLine("Enter List of Athletes participating in Event 1:");
event1.ListofAthletes = Console.ReadLine();
string test;
test = Convert.ToString(event1.ListofAthletes);
eventsarray[0] = event1;
ListofAthletesArray[0] = test ;
What would I use to convert the string of event1.ListofAthletes to so that it can go inside the array?
Any suggestions would be appreciated :) THanks in advance