Returning a pointer to a vector

I am trying to return a pointer to a vector but I am getting an error,
C2440 initializing cannot convert from vector <Ty> to char.

Ive hit F1 on error 2440 but the examples dont make sense to me because they dont apply to my problem and I cant seem to figure it out.

1
2
3
4
5
6
7
8
9
vector<char> naAllyVector;
char * getvector (char idtag)
{
if (idtag == 'ac') 
   {
         char * vectorptr = &naAllyVector;  
         return  vectorptr;
    }
}


I feel as though the problem is &naAllyVector, but again, cant figure it out.
Is it even possible to return a pointer to a vector??

Thanks for any help.

the return type of your function should be vector<char>*, and the pointer vectorptr should be vector<char>*
Last edited on
ahh... excellent. Thanks Skillness, Ill give that a shot tomorrow. Thanks again.
Heh, everyone misspells Skillless' name. :P
Damn my eyes ...
Topic archived. No new replies allowed.