原本*号前面的类型是我用typedef自定义的类型的,MyType* const p;

发生这样的错误是,编译器根本不知道MyType是什么东西,这是我在C++多重继承中遇到的。MyType是我在基类中public中定义的类型,结果在它的孙子类发生出这样的情况,不识别这个新类型。但是儿子类中也有MyType类型,却没有报错。

在孙子类中根据基类重新typedef下MyType就好了,编译器就能识别次类型了。

reference:

http://stackoverflow.com/questions/3720034/error-expected-before-token

g++ error: expected ‘)’ before ‘*’ token的更多相关文章

  1. g++ error: expected nested-name-specifier before 'XXX'

    template <typename addrT=int,typename valuT=int,typename stream_addrT=bm_addr,typename stream_siz ...

  2. 坑备忘error: expected class-name before '{' token

    今日重构之前的代码,修改了命名空间,然后一处派生的子类定义处总是总是报error: expected class-name before '{' token,网上查了查原因,出现这种情况大致有两种情况 ...

  3. error: expected constructor, destructor, or type conversion before '.' token

    今天写代码是遇到这样一个问题error: expected constructor, destructor, or type conversion before '.' token:立马网上查,原来是 ...

  4. 错误解决:error: expected ‘;’, ‘,’ or ‘)’ before ‘&’ token

    今天看到一个比较有趣的题目,如下代码,分析输出结果 #include <stdio.h> void num(int &b) { b = 222; return; } int mai ...

  5. Centos 7 成功安装 dosbox 解决 "error: expected primary-expression before ‘,’ token" 错误

    dosbox-0.74 bug 修复版下载: http://download.csdn.net/detail/yangbodong22011/9663271 注意:这篇博客解决了下面这个问题,如果你也 ...

  6. linux shell-syntax error near unexpected token错误

    在windows下用记事本编写linux shell脚本后,执行遇到syntax error near unexpected token错误 问题原理:网上找了好久,找到原因,原来是回行的问题,每个系 ...

  7. Error: expected expression, got '}'

    1.错误描述 Error: expected expression, got '}' .globalEval/<@http://localhost:8080/Sys/resource/globa ...

  8. Error_Unix Shell_syntax error near unexpected token `fi'

    2014-06-19 BaoXinjian 1. Issue 调用如下Shell脚本时出现错误syntax error near unexpected token `fi'

  9. 关于报错“syntax error near unexpected token `”和回车换行

    本来是很简单一个事情,转过来是因为打字机这事比较有趣…… http://blog.csdn.net/xyp84/archive/2009/08/11/4435899.aspx 摘要一下: 回车 换行 ...

随机推荐

  1. 画图工具Graphviz安装配置

    Graphviz (英文:Graph Visualization Software的缩写)是一个由AT&T实验室启动的开源工具包,用于绘制DOT语言脚本描述的图形.它也提供了供其它软件使用的库 ...

  2. HDU4532(组合DP)

    题目:安排座位 解析:http://www.douban.com/note/269136472/ #include <iostream> #include <string.h> ...

  3. EBS查询用户客户化的文件配置

    select pro.profile_option_name, pro.user_profile_option_name, lev.level_type type, --lev.level_code, ...

  4. Find Successor & Predecessor in BST

    First, we use recursive way. Successor public class Solution { public TreeNode inorderSuccessor(Tree ...

  5. Java vs Python

    面试时常问到这两种语言的区别,在此总结一下. Referrence: Udemy:python-vs-java Generally, Python is much simpler to use, an ...

  6. DirectX 开发环境配置

      想使用DirectX开发游戏,前提是要搭建DirectX的开发环境啦. 下面我们就一起学习下DirectX开发环境搭建 1. 首先是DirectX SDK安装, 下载地址是: http://www ...

  7. 为github帐号添加SSH keys

    为github帐号添加SSH keys 2012-05-26 00:05 34279人阅读 评论(6) 收藏 举报 ssh文本编辑gitvim工具up 使用git clone命令从github上同步g ...

  8. Spring 反转控制(IOC) 依赖注入(DI)

    简单的理解: 之前是我为了完成业务A 需要某个对象B的支持 那么我在这个业务A中就会创建一个对象B使用,说白了就是我根据需求来控制对象B, 而spring的ioc把对象B的控制权从业务A手中拿到自己手 ...

  9. Oracle 更改用户名

    直接更改系统user$表中的用户名. 查询要更改的用户名 SQL> select user#,name,password from user$ where name ='TICKETS'; US ...

  10. jquery返回顶部

    // 返回顶部 var fixed_totop = $('.back_top').on('click',function(){ $('html, body').animate({scrollTop: ...