I am new to C++ and to programming in general. I am trying to make this small code but when I want to use the if function I get this error.
I have no idea what it could be. I tried several conventions and none of them work. I was hoping someone could give me advice on how to write this line of code better. here is the thing
#include <iostream>
#define EXIT_SUCCESS 0
using namespace std;
int main()
{
//variables
char cod_ref[6];
char des_prod[60];
char disp;
int size;
int cost;
int price;
int num;
//impresiones y asignación de variables
cout<<"Digite el codigo de referencia del producto (5 digitos)" << endl;
cin.getline(cod_ref, 6);
cout<<"Digite la descripción del producto"<<endl;
cin.getline(des_prod, 60);
cout<<"Digite la talla del producto"<<endl;
cin>>size;
cout<<"Cantidad de productos"<<endl;
cin>>num;
cout<<"¿Disponible para la venta? S/N"<<endl;
cin>>disp;
cout<<"Digite el costo por unidad"<<endl;
cin>>cost;
cout<<"Digite el precio de venta por unidad"<<endl;
cin>>price;
//limpieza de pantalla
system("cls");
//impresión final
cout<<"REFERENCIA: "<< cod_ref <<endl;
cout<<"DESCRIPCIÓN: "<< des_prod <<endl;
cout<<"DISPONIBILIDAD: ";
if( disp == "s"||"S" ){
cout<<"Disponible";
}else{
cout<<"No Disponible";
}
cout<<"COSTO UNIDAD: "<< cost <<endl;
cout<<"COSTO TOTAL: "<< cost * num <<endl;
cout<<"PRECIO UNIDAD: "<< price <<endl;
cout<<"PRECIO POR "<< num <<" UNIDADES: "<< price * num <<endl;
cout<<"GANANCIA POR UNIDAD: "<< price - cost <<endl;
cout<<"GANANCIA TOTAL: " << (price * num) - (cost * num) <<endl;
//cout<<"PORCENTAGE DE GANANCIA: "<<
system("pause");
return EXIT_SUCCESS;
}
here is where i get the error
if( disp == "s"||"S" ){