The addition of a string literal with an std::string
yields another std::string
. system
expects a const char*
. You can use std::string::c_str()
for that:
string name = "john";
string tmp = " quickscan.exe resolution 300 selectscanner jpg showui showprogress filename '"+name+".jpg'"
system(tmp.c_str());