so If I modify this code will it work?
Qt Code:
void Factura::procesar( int cantidad, int precio ){ costoFinal = cantidad * precio; precioFinal += costoFinal; }To copy to clipboard, switch view to plain text mode
so If I modify this code will it work?
Qt Code:
void Factura::procesar( int cantidad, int precio ){ costoFinal = cantidad * precio; precioFinal += costoFinal; }To copy to clipboard, switch view to plain text mode
I found the and fixed the problem, now it works correctly, the problem was that I did not initialize PrecioFinal before using it, but it had to be done inside the constructor...
Factura::Factura(){
precioFinal = 0;
establecerDatos( numeroDePieza = "", descripcionDePieza = "", cantidadDeArticulos = 0, precioDeArticulo = 0 );
}
still I do not undesrtand why, if I try to initialize precioFinal to 0 inside Factura.h it fails to do so...
the error message I get for this is : C:\Users\eyel\Desktop\CBlocks\Clase9\Factura.h|30|warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11|
Bookmarks