База ответов ИНТУИТ

Язык программирования C++ для профессионалов

<<- Назад к вопросам

К какому виду относится класс, объявленный так:

  class vector_handler   { vector* p;    public: vector* operator->() { return p; }            vector_handler(vector* pp) : p(pp) { }  };    

(Отметьте один правильный вариант ответа.)

Варианты ответа
конкретный тип
абстрактный тип
интерфейсный класс
управляющий класс(Верный ответ)
узловой класс
Похожие вопросы

Что производит эта программа?

#include <fstream>#include <vector>#include <stack>using namespace std:int main(){ifstream in ("inpnum");stack <int. vector<int> > s;int x;while ( in >> x. !in.eof()) s.push(x);while (!s.empty()){X = s.top(); cout << x << " ";s.pop();return 0;}}	

Для чего предназначена следующая программа и верна ли она:

#include <iostream>#include <fstream>#include <vector>#include <stack>using namespace std;int main(){    ifstream in ("inpnum");    stack <int, vector<int> > s;    int x;    while (in >> x, !in.eof()) s.push(x);    while (! s.empty())    {        x = s.top(); cout << x << " ";        s.pop();    }}

К какому виду относится класс, объявленный так:

  class dim   { public: virtual void add(X*) = 0;            virtual void sub(X*) = 0;            virtual int sum() = 0;            virtual ~dim(){};  }    

Объявлен класс:

  class Point  {   int x,y,z;      char *s;    public:      Point(int,int,int, char*);      int GetX() { return x;}      int GetY() { return y;}      int GetZ() { return z;}      Point* operator->()       { return this;}   };  Point::Point(int x1,int y1,int z1, char * s1)       { x=x1; y=y1; z=z1; int n=strlen(s1); s=new char[n+1];         for(int i=0;i<=n;i++) s[i]=s1[i];}  
Какие из следующих операторов приведут к ошибкам компиляции?
Что обозначает следующая запись?
class Block<int, 100>{public:Вlоск() {р = new int [100];}~Block {delete [ ] p;}operator int * ( );protected:int * p;};Block<int, 100>:: operator int *(){return р;}

Объявлен класс A и объект d:

class A { int a, b, c; public: A() {a = 1; b = 2; c = 3; }; int get_a() { return a; } int get_c() { return c; } int get_b() { return b; } };  A* d = new A();
Как обратиться к переменной с?

Определены классы:

  class window   { virtual void move();  };  class figure   { virtual void move();  };  class cwindow : public window  { virtual int wmove(int) = 0;    void move() { wmove(); }  };  class cfigure   { virtual int fmove(int) = 0;    void move() { fmove(); }  };  class wind_fig : public cwindow, public cfigure  { void wmove();    void fmove();  };  
К какому виду относится класс wind_fig?

Что будет выведено на экран?

  class A  { public:    A() { x = 1; };               int f() { return x; };    protected: int x;  };  class B  { public:    B() { x = 2; };               int f() { return x; };    protected: int x;  };  class C : public A, public B  {  };   C* c = new C;  cout << c->f();  delete c;  

Объявлен класс A и объект d:

class A { int a, b, c;    public: A() {a = 1; b = 2; c = 3; };            int get_a() { return a; }            int get_c() { return c; }            int get_b() { return b; }};  A* d = new A;
Как обратиться к переменной с?

Какое отношение между классами реализовано в данном случае?

   class A  {  public: A() { a = 0; };             virtual int f() { return a; }             int a;  };  class B: public A  {  public: B() { a = 1; };     virtual int f() { return a; }  };