class Vect {
public:
Vect(int n);
~Vect();
Vect(const Vect& original);
private:
int* data;
int size;
};
Vect::Vect(int n) {
size = n;
data = new int[n];
}
Vect::~Vect() {
delete [] data;
}
Vect::Vect(const Vect& original) {
size = original.size;
data = new int[size];
for (int i = 0; i < size; ++i) {
data[i] = original.data[i];
}
}
#include <bits/stdc++.h>
using namespace std;
int main(void) {
Vect a(100);
Vect b = a;
Vect c;
c = a;
return 0;
}
I have a Vect class now, in main I created a Vect object that variable c holds, what will be the default size of c.size ?? Or It won't have any default? If it does not have a default value then how does b have 100 (as in a.size is now equals b.size)?