I have a project where I must use pointers to do a search on some accounts I've built up into a vector. My problem is whenever I try to pass the vector to a pointer I get an error. I've tried many different things but to no avail. Maybe one of you can tell me what I'm doing wrong?
This is basically what I'm trying to do:
#include <vector> using namespace std; double * func() { vector<double> vec; return vec; } int main() {double * p; p=func(); return 0; }
The error I get:
test.cpp: In function `double* func()':
test.cpp:7: cannot convert `std::vector<double, std::allocator<double> >' to `
double*' in return