c++ - How to write a recursive function for this? -


int main() {      lstnode tmp_list;      tmplist.insrtnumber( 10 );     tmplist.insrtnumber( 19 );     tmplist.insrtnumber( 39 );      tmplist.prntlist( );       return 0; } 

how write recursive print function? totally confused , not know start from? appreciated.

// print list void list_node::print_list () {     print_remaining_nodes ( list_head ); }  void list_node::print_remaining_nodes( number_node* from_node ) {     if ( from_node == null )     {         return;     }     else     {         cout << " " << from_node->value << " --- ";         print_remaining_nodes (from_node->next_node);     } }; 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -