Advertisement
karlicoss

Untitled

Apr 12th, 2012
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. using namespace std;
  5.  
  6. struct Foo
  7. {
  8. int a;
  9. double r, b, c;
  10. char d;
  11. /*~Foo()
  12. {
  13. cerr << "Foo destructor with a = " << a << endl;
  14. }*/
  15. };
  16.  
  17. vector<Foo> nodes;
  18.  
  19. int run(int from, int to)
  20. {
  21. //cerr << "From = " << from << " To = " << to << endl;
  22.  
  23. if (from == to)
  24. return 1;
  25.  
  26. nodes.push_back(Foo());
  27.  
  28. nodes[0].a = run(from, to - 1);
  29.  
  30.  
  31. //int res = run(from, to - 1);
  32. //nodes[0].a = res;
  33.  
  34.  
  35. return 1;
  36. }
  37.  
  38. int main()
  39. {
  40. //nodes.resize(1);
  41. run(0, 3);
  42. return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement