What will be printed out as a result of the following code execution?
#include <iostream>
class A {
    explicit A(int _k = 10) {k = _k;}
    int k;
int main() {
    A a = int(100);
    std::cout << a.k;  
Compilation error will occur because of the following. Since default constructor is declared with an explicit modifier, it will not serve as a type conversion constructor.

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Зареєструйся Зараз
або Підпишись на майбутні тести