I started programming since 2 days and im still a little noob at C++
When I debugged my code I got the following error at line 9:
ambiguous overload for 'operator>>' in 'std::cin >> dolar'|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include <iostream>
usingnamespace std;
int dolar();
int precio();
int total();
int main() {
cout << "Por favor, introduci el precio del dolar: ";
cin >> dolar;
cout << endl;
cout << "Introduci el precio del objeto en dolares: ";
cin >> precio;
total = (precio*dolar)+((precio*dolar)/100*35);
cout << endl;
cout << "El precio del producto, más impuestos de aduana es ";
cout << total;
cout << " pesos";
}
That's because dolar is a function prototype and not a variable.
Line 13: Same problem.
Line 17: That's going to output a function address, not the value returned by the function. If you want to output the value returned by the function call, use ().