fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <cstdlib>
  4. #include <cassert>
  5. #include <ctime>
  6. #include <map>
  7.  
  8. using namespace std;
  9.  
  10.  
  11. struct SBLnode {
  12. string name;
  13. SBLnode *next;
  14. SBLnode * left, * right;
  15. };
  16.  
  17. struct Queue {
  18. SBLnode * first, * last;
  19. };
  20.  
  21. typedef SBLnode* BST;
  22.  
  23.  
  24. struct SBL {
  25. Queue q;
  26. BST root;
  27. };
  28.  
  29. static const struct SBL EmptyStruct = { };
  30.  
  31. void SBL_init (SBL& sbl) {
  32.  
  33. sbl = EmptyStruct;
  34.  
  35. }
  36.  
  37. int main() {
  38. // your code goes here
  39. struct SBLnode initial;
  40. initial.name = "initial";
  41. struct Queue q;
  42. q.first = &initial;
  43. cout << q.first->name << endl;
  44. struct SBL testInit;
  45. testInit.q = q;
  46. cout << testInit.q.first->name << endl;
  47. SBL_init(testInit);
  48. cout << testInit.q.first->name << endl;
  49.  
  50. return 0;
  51. }
Runtime error #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
initial
initial