I'm trying to create a Node object using class Node:
int main(){
for(int i=0; i< 20; i++)
Node *handle = new Node(i, 10);
}
class Node{
public:
static vector<Node> map;
static int totalNodes;
vector<Node> connections;
int NodeID;
Node(int ID, int weight){
NodeID = ID;
CreateConnections(weight);
totalNodes++;
map.push_back(*this);
}
For some reason I get
'Node' : undeclared identifier
'Node' handle : undeclared identifier
syntax error : identifier node
Moving main() down after the class gives me
unresolved external symbol
for Node::map and Node::totalNodes
I'm somewhat new to C++ so any tips would be appreciated.