I tried to run command with help of system() function, forwarding argument as in code below:
std::stringstream volume_control;
int volume_value = 5;
volume_control << "/usr/bin/amixer cset numid=1 " << volume_value << std::endl;
system(volume_control.str());
It doesn't work, because of unsuccessful conversion of std::stringstream to const char*.
I know that in std::string case I have method std::c_string() and If I'm right it returns exactly what I need const char* type, but in this case of stringstream that method does not exist. So what to do?