D
david
Hello,
Is the code below correct ? I always get an seg fault on execution and
the debugger points to c_str() ?
Basically i want to convert the value std::string to char * within the
iterator loop.
.....
{
.....
for(std::vector<std::string>::iterator tag = tags.begin(); tag
!=tags.end(); tag++)
{
char *value = strdup(tag->c_str());
d_something..
free(value);
}
....
}
Is the code below correct ? I always get an seg fault on execution and
the debugger points to c_str() ?
Basically i want to convert the value std::string to char * within the
iterator loop.
.....
{
.....
for(std::vector<std::string>::iterator tag = tags.begin(); tag
!=tags.end(); tag++)
{
char *value = strdup(tag->c_str());
d_something..
free(value);
}
....
}