Not sure how to phrase title so sorry for poor wording but if I have something like this
public class Item
{
public string itemName;
public double itemPrice;
public double shipping;
public double tax = 0.12;
public double total;
}
Then I proceeded to declare an array
Item[] item = new Item[100]
I feel like this is a bad way to create an array like this but the problem here is an arbitrary sized array so I know for sure it will be under 100 but the items will keep getting added on.
How can I now edit item[0]'s itemPrice?
I tried using:
item[0].itemPrice = 34;
but with no avail.
Thanks!