开发者

What does :: at function name mean?

I saw code like:

using namespace zzzz;

void XX::YY()
{

}

how 开发者_如何学Godoes :: work if you write like that?


It's not Java, it's C++. (The using namespace and the :: is the giveaway).

The :: is the "scope operator". It's how in C++ you say that YY is a member of the class XX. Java doesn't need this because methods are always defined within the class they belong to; in C++ you can define them in another file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜