【C++】error: passing ‘const xxx’ as ‘this’ argument discards qualifiers [-fpermissive]
错误原因将“constxxx”作为“this”参数传递会丢弃限定符当函数参数为const的对象,需要给函数添加限定符const,使函数不改变该对象内容。修改前classUserProfile{public:enumulevel{base,middle,high,expert};UserProfile()=default;UserProfile(stringlogin,ulevel=base);bo