Possible Duplicate:
How can I pass a vector variable to a function?
I have following code:
std::vector <const char*> value;
value[0] = buf.c_str();
// Now I have to pass the vector variable to function.
// Function declaration: int my_function(const char *)
my_function(value[0]);
However, I'm getting this error:
error: cannot convert '
std::vector<char*, std::allocator<char*> >
' to 'const char*
' for argument '1' to 'int my_function(const void*)
'
Can you please help me resolve this problem?