Hello good evening,I read on stackoverflow that it may be because I did not create any object or because I initialized it but it is not currently initialized.
How can I fix it, it doesn't tell me what line the error is on. thanks.
How can I fix it, it doesn't tell me what line the error is on. thanks.
Program.cs:
class Program
{
static void Main(string[] args)
{
Articulo[] articulos = new Articulo[10];
for (int i = 0; i < 10; i++)
{
Console.WriteLine(" ingese el codigo del art");
articulos[i].codArticulo= int.Parse(Console.ReadLine());
Console.WriteLine(" ingese el precio del art");
articulos[i].precio = float.Parse(Console.ReadLine());
Console.WriteLine(" ingese marca");
articulos[i].codigoMarca = int.Parse(Console.ReadLine());
}
//CON ESTO YA ESTAN CARGADO LOS 10 ART Y EN VEZ DE HACER 3 VECTORES HICIMOS SOLO UNO Y SUS 3 PROPIEDADES
Venta venta = new Venta();
Console.Write("pon cod cliente");
venta.CodigoCliente = int.Parse(Console.ReadLine());
while (venta.CodigoCliente !=0)
{
Console.Write("ingrese venta");
venta.Cantidad = int.Parse(Console.ReadLine());
Console.Write("pon cod art");
venta.CodigoArticulo = int.Parse(Console.ReadLine());
Console.Write("pon cod cliente");
venta.CodigoCliente = int.Parse(Console.ReadLine());
}
}
}
}