I am starting to learn C++ and I am trying to create a program that asks the user to add values for all primitive types in C++, here is what I have written so far:
#include <iostream>
using namespace std;
int main()
{
bool empty_bool;
char empty_char;
int empty_int;
float empty_float;
double empty_double;
cout << "Please enter a value for all inbuilt primitive types in C++" << endl;
cout << "Boolean:";
cin >> empty_bool;
cout << "Char";
cin >> empty_char;
cout << "Int";
cin >> empty_int;
cout << "float";
cin >> empty_float;
cout << "double";
cin >> empty_double;
}
The problem is that my program takes the input of boolean but then it just prints the rest of the variable names but it doesn't allow to take the value for the said variable and I can't figure out why, what am I doing wrong here?