Тема: Яким повинен бути конструктор класу?
#include<iostream>
class matrytsja
{   private:
        int x,y;
        int **m;
    public:
        matrytsja(int _x=0, int _y=0) : (x=_x,  y=_y)
        {
                m=new int*[x];
                for (int i=0; i<x; i++)
                m[i]=new int [y];
        }
        ~matrytsja()
        {
            for(int i=0; i<x; i++)
            delete []  m[i];
            delete []  m;
        }
};
int main()
{
    std::cout << "Y" << std::endl;
    matrytsja m1(50,100);
return 0;
}||=== Build: Debug in matrytsja (compiler: GNU GCC Compiler) ===|
G:\Heloworld\matrytsja\matrytsja.cpp||In constructor 'matrytsja::matrytsja(int, int)':|
G:\Heloworld\matrytsja\matrytsja.cpp|9|error: anachronistic old-style base class initializer [-fpermissive]|
G:\Heloworld\matrytsja\matrytsja.cpp|9|error: unnamed initializer for 'matrytsja', which has no base classes|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 9 second(s)) ===|
Завжди здається я так писав, і от на тобі, це ж таке треба.... Я навить английською одразу все зрозумів. А як тоді треба??