User Profile
Collapse
-
Thanks for the help. I started rearchitecting my code, but decided that simply using extern would fix the issue. -
The code sample I included was a demonstration of the concept.
The actual structure is somewhat more complicated.
There are 120 nodes. Each node keeps a list of three types of neighbors, as well as 7 other pieces of information.
This seems more cumbersome:
------------------
node1.neighbor_ type1[0]=&node2;
node1.neighbor_ type1[1]=&node3;
node1.neighbor_ type1[2]=&node4;...Leave a comment:
-
circular struct reference in c++
I am trying to represent a map using nodes. This code segment seems to work just fine in C, but craps out in C++.
struct node{
char name[50];
struct node* neighbors[6];
};
struct node one;
struct node two;
struct node three;
struct node one={"one",
{&two, &three}
};
struct node two={"two",
...
No activity results to display
Show More
Leave a comment: