I cannot get this code to work for me:
List<String[]> campaigns = new List<String[]>();
for(int i = 0; i < C; i++){
campaigns.Add(new String[]{
weekYear = something[i],
campaign = info[i],
totalBids = Total1[i],
highestBid = Highest[i],
});
}
list = campaigns.ToArray();
I am pretty sure I need to replace String[] with something else, but what?
string
will not have the properties your trying to instansiate, surely this should be an object that you have created with theweekYear
property inside?campaigns.Add(new String[] { something[i], info[i], ... })
and later access them by index.Campaign
and set each property on it to the type it needs to be.List<>
, and then eventually call.ToArray()
, because you know from the beginning that there's going to be exactlyC
elements in you list.