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
operators
:
Content language: Русский
English
В каких из следующих выражений запятая является оператором (comma operator) {и является точкой следования (sequence point)}, а в каких разделителем (comma separator) {и НЕ является точкой следования} /*1*/ int a=2, b=3; /*2*/ f( g(a), h(b) ); /*3*/ c = ( g(), h() ); Выберите номера строк, в которых запятая является оператором
operators
Что напечатает следующий код: #include <iostream> using namespace std; struct A { A& operator++(int) { cout << "++"; return *this; } A& operator--(int){ cout << "--"; return *this; } }; int main() { A a; a++--; return 0; }
operators
В каких из следующих выражений запятая является оператором (comma operator) {и является точкой следования (sequence point)}, а в каких разделителем (comma separator) {и НЕ является точкой следования} int a, b; /*1*/ f(a,b); /*2*/ a=2, b=3; /*3*/ int c[] = {1,2,3}; Выберите номера строк, в которых запятая является оператором
operators
В каких строках содержатся ошибки? #include <string> using std::string; class A { }; void operator&(int, int); //1 void operator&(A, int) { } //2 void operator&(int, const A&); //3 void operator&(A, A); //4 void operator&(A*, A*) { } //5
operators
Какой вывод будет у этой программы? #include <iostream> struct A; int operator+(const A&, const A&) { return 3; } struct A { operator int() { return 1; } }; int main() { A a, b; std::cout << a + b; }
operators
Что будет выведено на экран в результате выполнения следующего кода? #include <iostream> class A { public: A() { } operator int() { return 10; }; operator float() const { return 2.0; }; }; class B { public: B() { } operator int() const { return 5; }; operator float() { return 1.0; }; }; int main() { A a; B b; std::cout << a + b << std::endl; return 0; }
operators
Чему будет равно значение i, после выполнения следующей программы: int i = 6; i = 7,i++,i++;
operators
Какой вывод будет у этой программы? #include <iostream> struct A { operator int() { return 1; }; operator double() { return 2.0; } }; int main() { A a; int i = a; float x = a; x += i; std::cout << x; }
operators
Что напечатает следующая программа #include <iostream> using namespace std; class A { int i; public: A() { cout << "in A::A()" << endl; i = 0; } A operator = (A a) { cout << "in A::operator=(A)" << endl; i = a.i; } }; int main() { A a; A b = a; return 0; }
operators
Что будет выведено в stdout при выполнении следующего кода? #include <iostream> struct A { A() { std::cout << "A"; } ~A() { std::cout << "~A"; } }; int main() { A *a = (A *) operator new(sizeof *a); delete a; }
operators
← Prev
2
3
4
5
6
Next →
Sign Up Now
or
Subscribe for future quizzes