Quizzes
Site Language: English
Українська
English
Русский
Programming Tests
Login
Sign Up
Programming Tests
Theory
Snippets
Papers
Landing
Android
Prices
FAQ
Cosmo Story
Terms and Conditions
Privacy Policy
Cookies Policy
Send Feedback
explicit-type-conversion
:
Content language: Русский
English
В даном коде есть ошибки создания объектов классов A и B, в каких строчках кода функции main содержаться : #include <iostream> using namespace std; class A { public: A() { n = 0; } explicit A( int t) { n = t; } int n; }; class B { public: B(int t) { n = t; } int n; }; int main(int argc, char *argv[]) { A a1 = 7; // 1 A a2; // 2 A a3 = A(7); // 3 A a4(7); // 4 B b1 = 6; // 5 B b2 = B(6); // 6 B b3; // 7 return 0; }
explicit-type-conversion
Каким будет значение b, если bool b = (double)(1/2)
explicit-type-conversion
Что будет выведено на экран? #include <iоstrеаm> class А { public: А(){ }; ~А(){ }; еxрliсit А(int а); ореrаtоr int(){rеturn 1;} }; int main(int argc, char* argv[]) { A foo; int value = fоо + 1; std::cout << value << std::endl; return 0; }
explicit-type-conversion
← Prev
1
Next →
Sign Up Now
or
Subscribe for future quizzes