I want to understand how to read a getline string and ignore any white spaces, new lines, or tabs using bool functions. They will then only calls a function when the input is a double or a specific char such as "+, -, *, /"
#include<iostream>
//#include"inter.h" // You may disregard any functions that would come from inter.h
#include<string>
using namespace std;
bool is_num(string input);
bool is_space(string input);
bool is_oper(string input);
int main(){
string input;
getline(cin,input);
while (cin >> input); // read input until user enters ctrl d
if(input.is_num(input == true) {
// calls a push function from inter.h
}
else if(input.is_space == true){
// ignores any white spaces, tabs or new line and continues to read input
}
else if (input.is_oper == true){
//calls my pop function from inter.h
}
}
bool is_num(string input){
// No idea what would go here
return true;
}
bool is_space(string input){
// No idea what would go here needs to ignore any white space or endl;
return true;
}
bool is_oper(string input){
// No idea what would go here
return true;
}