天嵌 ARM开发社区

 找回密码
 注册
查看: 2159|回复: 2

做QT出现的问题

[复制链接]
tyf3811 发表于 2009-10-21 11:06:20 | 显示全部楼层 |阅读模式
当我在first.cpp中加入int z,x,y后,然后
void first::user_button22()
{
    int i=0,a;
    switch ( p )
    {
     case '+':
          z=x+y;
          break;
     case '-':
          z=x-y;
          break;
     case 'x':
          z=x*x;
          break;
     case '*':
          z=x*y;
          break;
     case '/':
          z=x/y;
          break;
    }
其中有+号后,编译就出现了如下错误
first.cpp:245: invalid use of member (did you forget the `&' ?)
first.cpp:245: invalid use of member (did you forget the `&' ?)
first.cpp:248: invalid use of member (did you forget the `&' ?)
first.cpp:248: invalid use of member (did you forget the `&' ?)
first.cpp:251: invalid use of member (did you forget the `&' ?)
first.cpp:251: invalid use of member (did you forget the `&' ?)
first.cpp:254: invalid use of member (did you forget the `&' ?)
first.cpp:254: invalid use of member (did you forget the `&' ?)
fengliu256 发表于 2009-10-21 13:27:39 | 显示全部楼层
贴的代码不完整,不够我觉得应该如果p是字符指针的话,前面要加&来解引用
亚瑟王 发表于 2009-10-22 10:44:15 | 显示全部楼层
245行指的是源码的哪一行啊?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号 )

GMT+8, 2024-4-30 06:55 , Processed in 1.078132 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表