You seem to be misunderstanding something. Think of a char just like you would for your ints, just only a single character instead. So, though it is easiest to have a temporary just for the slashes, just have another one for the operation. Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <iostream>
int main() {
int n1, d1, n2, d2;
char op, temp;
std::cout << "Please enter you operation: ";
std::cin >> n1 >> temp >> d1 >> op >> n2 >> temp >> d2;
// now, you have two fractions n1/d1 and n2/d2, as well as the
// operation to perform with them in op (e.g. '+', '-', etc...)
// ...
return 0;
}
1. try 'iostream' instead of 'oistream'
2. slash = '\\';
3. you can declare another char called operation to cin the operation selection required
4. use separate cin's for the numbers and operation
5. float or double would be better than int unless you want integer division truncation - eg 2/3 with integers equals 0!
<oistream>, that's the library my Jewish uncle used when he was frustrated.
Yeah I know Essler. <oistream> has a method called vey - it lways make me laugh when I call oi.vey() but there you go. Tell your uncle that life is too short so try Java if the challenge of C++ is getting him down.