What is the member variables list after the colon in a constructor good for?

前端 未结 8 1042
予麋鹿
予麋鹿 2020-12-11 02:34

I\'m reading this C++ open source code and I came to a constructor but I don\'t get it ( basically because I don\'t know C++ :P )

I understand C and Java very well.

8条回答
  •  轮回少年
    2020-12-11 03:09

    Yes, :: is the C++ scoping operator which lets you tell the compiler what the function belongs to. Using a : after the constructor declaration starts what is called an initialization list.

提交回复
热议问题