I have a question about why I am getting an error when trying to overload an operator outside of a class. I do not understand what is happening. I get this error:
Error 1 error C2665: 'std::operator !=' : none of the 5 overloads could convert all the argument types Line 62
I know but this is a homework assignment so I have to do it both ways but I can't figure out what I am doing wrong using the function outside of the class.
I read that and understand how to write an overload function like that using a member function inside a class, but I need to be able to write a regular function outside of a class that can do the same thing.
The compiler needs to know what function you're talking about before you actually call it. Because you've declared the function AFTER you attempt to use it on line 62 of your original code, you're compiler is throwing an error because you've broken a syntax rule. You need to make a function prototype before your main function, and you'll be good to go.