Hi all,

Im rather new to C++ (Im changing from Java to C++), so please bear with me.
I have a question about STL and returning a vector array
from a static method.

How do I do it correctly, so that the function contructs
a vector that can be returned to the caller. I know if I
create a local object from a class and return it`s reference, it will point to null (if Im rigth) after the
function call. So the object should be created with the new
operator. But how do I do it with template call??
I just get errors when I try to compile.

It should go something like this(please, do correct my syntax, pointers and references are used very wrong, I think):

static &vector<MyClass> loadFromFile()
vector<MyClass> *data = NULL;
// load from file and populate the vector
{ }

return &data;

help apprecitaed!


ps. could somebody tell me where to fing a decent
standard C++ API (yes, I`m migrating from Java to C++). All I have found are rather hard to use / read or incomplete.

Thank you.