Examveda

What is the purpose of the 'explicit' keyword before a constructor in C++?

A. To mark the constructor as static

B. To specify the return type of the constructor

C. To allow implicit conversions during object initialization

D. To prevent implicit conversions during object initialization

Answer: Option D


Join The Discussion

Related Questions on Constructors and Destructors in C plus plus