panJames
asked on
C++, array of pointers to objects
Hello experts, please have a look at the code below:
How can I make it work?
Thank you
panJames
#include <iostream>
using namespace std;
class Dog{
public:
int x;
};
int main(){
Dog * matrix[12];
int * matrixInt[12];
*matrixInt[0] = 12; //works fine
*matrix[0]->x = 12; //does not work
return 0;
}
How can I make it work?
Thank you
panJames
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.