Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- struct Foo
- {
- int a;
- double r, b, c;
- char d;
- /*~Foo()
- {
- cerr << "Foo destructor with a = " << a << endl;
- }*/
- };
- vector<Foo> nodes;
- int run(int from, int to)
- {
- //cerr << "From = " << from << " To = " << to << endl;
- if (from == to)
- return 1;
- nodes.push_back(Foo());
- nodes[0].a = run(from, to - 1);
- //int res = run(from, to - 1);
- //nodes[0].a = res;
- return 1;
- }
- int main()
- {
- //nodes.resize(1);
- run(0, 3);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement