base operand of '->' has non-pointer type 'const Comple


base operand of '->' has non-pointer type 'const Comple

->操作符前面的操作数类型不是指针类型

 

错误原因 

函数(&对象)

{
 对象名.成员     //正确方式

 对象名->成员     //编译报错  base operand of '->' has  non-pointer type .......

}

 

引用传递的参数应该理解为对象,而不是指针


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM