fork download
  1. /*
  2.   Print elements of a linked list in reverse order as standard output
  3.   head pointer could be NULL as well for empty list
  4.   Node is defined as
  5.   struct Node
  6.   {
  7.   int data;
  8.   struct Node *next;
  9.   }
  10. */
  11. void ReversePrint(Node *head)
  12. {
  13. if(head != NULL){
  14. ReversePrint(head->next);
  15. std::cout << head->data << std::endl;
  16. }
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:11:19: error: variable or field 'ReversePrint' declared void
 void ReversePrint(Node *head)
                   ^
prog.cpp:11:19: error: 'Node' was not declared in this scope
prog.cpp:11:25: error: 'head' was not declared in this scope
 void ReversePrint(Node *head)
                         ^
stdout
Standard output is empty