I'm attempting to allocate memory for each entry of the array and initialize the members part1 and part2 to 0.
#include <iostream>
using namespace std;
class Two {
public:
int part1;
int part2;
};
int main() {
Two * dp[10]; //array of 10 pointers to objects of class Two
part1 = 0;
part2 = 0;
for (int i = 0; i < 10; i++) {
dp[i] = 0;
}
return 0;
}
Any help is appreciated. I'm new to c++ and I'm trying to understand the basic concepts. Thank you in advance!