no viable overloaded '=' error C++ -


i'm trying store proper ticket variable (either t1 or t2) t3 can return main. when use "=" set either t1 t3, says "no viable overloaded '='". following code:

using namespace std;  class ticket { public:     ticket();     double input();     double output();     friend ticket operator *(const ticket &t1, const ticket &t2);     friend ticket operator /(const ticket &t1, const ticket &t2); private:     void cost();     string name;     double miles, price;     int transfers; }; 

the variable c1 , literal '\0' of type char, not instances of character structure.

the types char , character totally unrelated , can't convert between two.

a simple solution create conversion constructors character structure, accepts single char argument , initialize structure character.

or create character structure , explicitly set correct member character want.


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -