Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the :: mean in C++? [duplicate]

Tags:

c++

methods

void weight_data::rev_seq(string &seq){ 
//TODO
std::reverse(seq.begin(), seq.end());
}

In this C++ method, I think this method does not return anything, so the prefix is void, what does :: tell the relationships between weight_data and rev_seq(string &seq)? Thanks!

like image 868
ladyfafa Avatar asked Aug 13 '10 20:08

ladyfafa


1 Answers

void is the return type. :: is the scope resolution operator, so it means rev_seq is inside the scope of weight_data. weight_data could be either a namespace or a class (based on what you've given, it's not possible to say which).

like image 58
Jerry Coffin Avatar answered Oct 13 '22 06:10

Jerry Coffin