C++ (Qt)class SomeClass : public QObject{ SomeClass :SomeClass (int i, QObject *parent = 0);}SomeClass *a;for (int i =0; i<maxVal; i++) { a = new SomeClass(i,parentObject); // ??? ///.......... ///using a //..........}
C++ (Qt)class SomeClass{ SomeClass :SomeClass (int i);}SomeClass *a;for (int i =0; i<maxVal; i++) {a = new SomeClass(i); // ??? ///..........///using a//..........}
C++ (Qt)class SomeClass : public QObject{ SomeClass::SomeClass (int i, QObject *parent = 0) : QObject(parent) {};}SomeClass *a;for (int i =0; i<maxVal; i++) { a = new SomeClass(i,parentObject); // ??? ///.......... ///using a //..........}
C++ (Qt)class SomeClass{ SomeClass ::SomeClass (int i){};}SomeClass *a;for (int i =0; i<maxVal; i++) {a = new SomeClass(i); // ??? ///..........///using a//..........}
C++ (Qt)while(!asleep()) sheep++;
C++ (Qt)// ------------------------------------------------------------class P : public QObject{ P::P (QObject *parent = 0) : QObject(parent) {};};// ------------------------------------------------------------class C : public QObject{ C::C (QObject *parent = 0) : QObject(parent) {};};// ------------------------------------------------------------...P *p = new P();C *c = new C(p);...delete p;...// будет ли удалет и *с - если да, где прочесть в доках?...
C++ (Qt)for (int i =0; i<maxVal; i++) { delete a; a = new SomeClass(i,parentObject); // ??? ///..........}