Hi guys,
What am I doing wrong here? Program dies on me @ merge(). :(
#include <iostream>
#include <vector>
using namespace std;
int main() {
int afrom[4] = {0,0,1,2};
int ato[4] = {1,2,3,4};
vector<int> from(&afrom[0], &afrom[4]);
vector<int> to(&ato[0], &ato[4]);
vector<int> length;
vector<int> all_nodes;
sort(from.begin(), from.end());
sort(to.begin(), to.end());
merge(from.begin(), from.end(), to.begin(), to.end(), all_nodes.begin());
return 0;
}
Thanks in advance,