Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1455036
  • 博文数量: 596
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 173
  • 用 户 组: 普通用户
  • 注册时间: 2016-07-06 15:50
个人简介

在线笔记

文章分类

全部博文(596)

文章存档

2016年(1)

2015年(104)

2014年(228)

2013年(226)

2012年(26)

2011年(11)

分类: C/C++

2012-11-21 00:16:53

The error new types may not be defined in a return type

can be caused by forgetting a semicolon on the end of the declaration of a class.

错误的写法:

foo.h:

class Foo
{
// stuff
} // missing semicolon

foo.cc:

#include "foo.h"
Foo::Foo(int x) // error shows up in this line
{
// stuff
}


正确的写法:

foo.h:

class Foo
{
// stuff
}; // yay, semicolon!

foo.cc:

#include "foo.h"
Foo::Foo(int x)
{
// stuff
}
阅读(955) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~