I am just wondering if there is a way of setting an initialized array of pointers to all null values without using a loop?
class Abc{
//An array of 2000 Product pointers
Product* product_[2000];
public:
Abc();
}
I want to set all pointers to null when the constructor is called:
Abc::Abc(){
product_ = {};
}
This does not work, product_ must be a modifiable value. Is there an easier way than looping 2000 elements?
Thanks.
Abc::Abc() : product_{} {}