Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ asterisk asterisk operator

I have never seen this operation done before in any languages, since this is a symbol google makes it hard to search.

What does ** mean ?

sf::TcpSocket& client = **it;

1 Answers

It's dereferencing a pointer to a pointer, in order to get to the original sf:TcpSocket.

It's just two * operators in a row.

In this case, you could also write:

// Given sf::TcpSocket **it;
sf::TcpSocket *tmp = *it; // Dereference once
sf::TcpSocket& client = *tmp;
like image 108
Reed Copsey Avatar answered Oct 23 '25 08:10

Reed Copsey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!