There is nothing wrong (syntactically) with the code you've shown, as evidenced by the following fully self-contained example:
#include <iostream> int main(){ char n1; char n2; int total; std::cout << "Enter roman numerals to change to numbers." << std::endl; n1 = std::cin.get(); n2 = std::cin.get(); return 0; }
This both compiles and runs fine, therefore your problem must lie elsewhere.
You need to take better note of the error message your compiler is giving you, specifically the line number. Then examine the file at or around that point (and show us if you cannot figure it out).
That's the sort of error message I'd expect to see if you accidentally declared your n1 or n2 variables as char * rather than char. In that case gcc gives me something similar to what you state:
qq.cpp: In function 'int main()': qq.cpp:9: error: invalid conversion from 'int' to 'char*' qq.cpp:10: error: invalid conversion from 'int' to 'char*'
std::stringandstd::getline()?std::string. Just accumulate the total as you walk through the string with an iterator.