This is my first calculator and it´s the first time I use functions or switch so I need help becuse it doesnt run. May someone tell me why it doesnt work?
Firstly switches only work on numerical variables (including char). You're switching on an integer however your cases aren't numerical. I'm not actually sure what those would be classified under haha. But they can't be treated as an int. Also cin << a << endl; should be
1 2
cin >> a;
cout << "\n";
You're using the << operator instead of the >> operator. << is only for cout.
And why are you assigning your functions to o? You can do this instead std::cout << addition(a, b);
Lastly, x and y are undeclared variables in your function calls in your switch statements.
Edit:
Also just change int o; to a char and put your case values in single quotations like so: