The error new types may not be defined in a return type
{
// stuff
} // missing semicolon
Foo::Foo(int x) // error shows up in this line
{
// stuff
}
{
// stuff
}; // yay, semicolon!
Foo::Foo(int x)
{
// stuff
}
阅读(195) | 评论(0) | 转发(0) |
<script>window._bd_share_config={"common":{"bdsnskey":{},"bdtext":"","bdmini":"2","bdminilist":false,"bdpic":"","bdstyle":"0","bdsize":"16"},"share":{}};with(document)0[(getelementsbytagname('head')[0]||body).appendchild(createelement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new date()/36e5)];</script>
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
}
相关热门文章
给主人留下些什么吧!~~
评论热议