c++ - `Class::Class() : a(0), b(1)` meaning -


this question has answer here:

what following mean? don't know search searching : gives me nothing...

server::server(int port) : listen_sock(0), current_autogen_nickname(1) 

where listen_sock used later in:

listen_sock = socket(af_inet, sock_stream, 0); 

and current_autogen_nickname not used.

it means defining constructor class server declared 1 int parameter. class has fields listen_sock being set 0 , current_autogen_nickname being set 1

you defining constructor , using initializer list.


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -