Is there anything that stands out in the following code that could cause me to get the error message "comparison between distinct pointer types lacks a cast" upon trying to compile it? I'm brand new to programming, so I apologize in advance if this code is hideous. . .
Thanks!Code:#include <iostream> #include <cmath> #include "is_an_op.h" using namespace std; double do_op(char op, double num_one, double num_two) { if (op == '/') && (num_two == 0) return 0.0; else if (is_an_op == "true") && (op == '+') return num_one + num_two; else if (is_an_op == "true") && (op == '-') return num_one - num_two; else if (is_an_op == "true") && (op == '*') return num_one * num_two; else if (is_an_op == "true") && (op == '/') return num_one / num_two; else return 0.0; }



LinkBack URL
About LinkBacks


