Basic C++ cin compiler problem
Hi lovely community <3. I trying to use a function and i got a litle problem, the compiler in code blocks only ask me the first CIN, if i answer both CIN in the first one the programm work fine, but i want that compiler make " Question --> answer , Question--> Answer " and NO "Question--> Answer, Answer, Question " sorry my english, doing my best. #include <iostream> using namespace std; char compra_libro(double precio_libro,double dinero_bolsillo); int main() { int precio_libro, dinero_bolsillo; char compra; cout<<"introduzca el precio del libro:\n"; //Here I enter the price of the book cin>>precio_libro; cout<<"introduzca su presupuesto:\n"; //Enter the money i got BUT the compiler jump the second cin cin>>dinero_bolsillo; cout<<endl<<endl; compra= compra_libro(precio_libro,dinero_bolsillo); if (compra=='A') { cout<<"la compra es posible de realizar";} else {cout <<"la compra no se puede realizar";} return 0; } char compra_libro(double precio_libro,double dinero_bolsillo) { while (dinero_bolsillo >= precio_libro) return 'A'; }