Link to home
Start Free TrialLog in
Avatar of seanmccully
seanmccully

asked on

Visual Studio 2008 C++ cannot convert parameter 2 from

I am getting the following compiler error in Visual Studio C++ that I am stumped on.

cannot convert parameter 2 from 'std::vector<_Ty>' to 'std::vector<_Ty> *'
with
1>        [
1>            _Ty=std::string
1>        ]
1>        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called

Whats the correct way to do this?
std::vector<std::string> tokens;
Tokenize(parameterArr[i]->Text,tokens);
 
void Tokenize(const String^ str,std::vector<std::string*>& tokens) {

Open in new window

Avatar of LordOfPorts
LordOfPorts
Flag of United States of America image

If your vector contains values by string value vs. pointers to strings which seems to be the case according to your declaration:

std::vector<std::string> tokens;

then try changing the second parameter of the Tokenize function to std::vector<std::string>& tokens, e.g.:
void Tokenize(const String^ str,std::vector<std::string*>& tokens) {

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of seanmccully
seanmccully

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
...sorry, correction:
void Tokenize(const String^ str,std::vector<std::string>& tokens) {

Open in new window