Thanks for the message. Bellow is the struct content:
Code:
http://www.graphviz.org/pub/graphviz/development/doxygen/html/graph_8h_source.html#l00060
Using
Code:
void myFunct( Agraph_t * g) {
FILE *fp;
/* say there is some fileName*/
fp=fopen(fileName.c_str(), "r");
g=agread(fp);
}
int main() {
Agraph_t* g;
myFunct(g);
Agnode_t *n=agfstnode(g);
}
everything compiles, but the change of g=agread(fp) does not take effect.
Changing as proposed,
Code:
Agraph_t g;
myFunct(&g);
results the following error message:
Code:
error: cannot convert ‘Agraph_t’ to ‘Agraph_t*’ for argument ‘1’ to ‘Agnode_t* agfstnode(Agraph_t*)’
So, the function agfstnode (from external library, as is Agraph_t) requires Agraph_t* as an argument. That was the reason for using it primarily.
Setting
Code:
Agnode_t *n=agfstnode(&g);
does compile, but the execution terminates at this point.
Some thoughts?