How can I create an array of nodes
I am trying to see if I can create an array of nodes. I think I have it down somewhat but this is what I have.
Code:
#include <iostream>
using namespace std;
/*This is a template of a person....sorta*/
class person{
public:
int data[32];
bool selected = false;
person(){
for (int x = 0; x < 32; x++){
data[x] = 0;
}
}
};
//This is where the magic happens
int main()
{
/*Variable block**********************************/
int row = 86;
const int column = 32;
/*************************************************/
/*Creates the nodes*/
person *bitstring = new person[row];
cout << bitstring->data[31] << endl;
return 0;
}
I am trying to see if there is a way for me to create a 86 slot array of person nodes. I am not sure how to do it and how to access them afterwards. I know that I am creating the bitstring of person correctly but I am not sure how to get the array of person going.