object *head = NULL, *tail = NULL; // EDIT
struct object {
vector <int> data;
object * read ( void ) ;
struct obj {
obj *next;
object * brach ( object * ) ;
};
};
object * object :: read ( void ) {
... // some code to read and return (dynamically token space) pointer
}
object * object :: obj :: brach ( object * p ) {
... // some code to make link list and pointer to middle
}
void show ( object * p ) {
... // to show data, from head to tail
}
A lot of question about nested structure, but I think all of them have similiar answer
If I want to put show function in read function, how can I use global show function in it?
some effort ;
object * object :: read ( void ) { ... // some code to read and return (dynamically token space) pointer :: show ( head ) ; ( ! ) head :: obj :: show ( head ) ; ( ! ) head . obj . show ( head ) ; ( ! ) }all of the line marked with ( ! ), gives error, WHY
in main function
object *p = new object ; ... // some code to read data object *tmp = NULL; tmp = p -> obj . brach ( p ) ; ( ! ) **how** can I fix it ?