I receive from another method a string
(I don’t know the size of this) and I want to fill my argv
(and get argc
) with this string
to pass to other method and I don’t know how to do it.
At the start of the string
I set the name of my app so I have a final string
like:
"myapp arg1 arg2 arg3 arg4"
The code I have is the following:
int main (int argc, const char* argv[])
{
while(true)
{
// send_string() give a string like: “the_name_of_my_app arg1 arg2 arg3 arg4”
std::string data = send_string();
argv = data;
argc = number_of_element_on_data;
other_function(argc, argv);
}
return 0;
}