Procedure that returns list<MyClass> cannot compile

Hello all,

I have a class called MyClass defined in C++. And I have a procedure that wants to return a list with MyClass objects.

I have the procedure declared on top of my code as:
1
2
3
4
5
6
7
8
static list<MyClass> MyProcedure(char *, int);

//then defined:

static list<MyClass> MyProcedure(char *searchstr, int pos)
{

}


But, when I compile I get the following errors:

1.error C4430: missing type specifier - int assumed.
2.error C3861: 'MyProcedure': identifier not found
3. error C2447: '{' : missing function header (old-style formal list?)
... and seven more.

What am I doing wrong?

Thanks!
static? I don't think you can have that on a global function.
Is it better if I return a pointer to my objects?
Even with a removed static the errors are the same.
Have you tried std::list?

Just in case, please list all 10 or so errors.
Thanks, std::list solved the issue! =]
Topic archived. No new replies allowed.