Help me with this pls, i am trying to make a calculator

Can someone help me? I’m trying to make a calculator

#include <iostream> int main() { char operation; std::cout << "please enter the operation that will be used(x for multiplication, / for division, + for addition, and - for subtratction."; std::cin >> operation; if (operation == x) { std::cout << "ok, now enter the first factor"; int first_factor; std::cin >> first_factor; std::cout << "ok, now enter the second factor"; int second_factor; std::cin >> second_factor; int answer; first_factor * second_factor = answer; std::cout << "the answer is " << answer << ". \n" }

The error message to much for my brain to handle

There’s more than one part to that error message, I’d highly suggest taking the time to read it as the compiler is your friend. Yes, the message is a bit verbose but it does tell what it thinks is wrong.

Consider the first issue. It’s telling you name of the file main.c, it tell you the line where it encountered an issue 8 and even the column 18 with main.c:8:18:.

main.c:8:18: error: ‘x’ was not declared in this scope
 if (operation == x) {
                  ^

That one seems clear enough, what is x? Is that supposed to be a variable? Is is supposed to be a character literal? Make sure you tell the compiler what it is.

Try breaking down your error messages like this, you shouldn’t fear them, they’re output for your sake to make your life easier. It’s an incredibly valuable skill to be able to read through their content as unless you’re superhuman you’ll find plenty more bugs in the future :slightly_smiling_face:.

the error is because you have not put the value in single quotes,
if (operation == ‘x’) {