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

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -